feat(am): inscription photo (picker, bytes web, photo_filename) (#120)
- ProfessionalInfoFormScreen : ImagePicker par défaut, MemoryImage, consentement si photo réelle - AmRegistrationData : photoBytes + photoFilename ; récap étape 4 - registerAM : base64 + filename, erreurs réseau/JSON comme parents - docs: 23_LISTE-TICKETS — issue #120 Made-with: Cursor
This commit is contained in:
@@ -6,27 +6,17 @@ import '../../models/am_registration_data.dart';
|
||||
import '../../models/card_assets.dart';
|
||||
import '../../widgets/professional_info_form_screen.dart';
|
||||
|
||||
class AmRegisterStep2Screen extends StatefulWidget {
|
||||
class AmRegisterStep2Screen extends StatelessWidget {
|
||||
const AmRegisterStep2Screen({super.key});
|
||||
|
||||
@override
|
||||
State<AmRegisterStep2Screen> createState() => _AmRegisterStep2ScreenState();
|
||||
}
|
||||
|
||||
class _AmRegisterStep2ScreenState extends State<AmRegisterStep2Screen> {
|
||||
String? _photoPathFramework;
|
||||
|
||||
Future<void> _pickPhoto() async {
|
||||
// TODO: brancher ImagePicker ; ne pas préremplir de chemin factice
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final registrationData = Provider.of<AmRegistrationData>(context, listen: false);
|
||||
|
||||
// Préparer les données initiales
|
||||
ProfessionalInfoData initialData = ProfessionalInfoData(
|
||||
|
||||
final initialData = ProfessionalInfoData(
|
||||
photoPath: registrationData.photoPath,
|
||||
photoBytes: registrationData.photoBytes,
|
||||
photoFilename: registrationData.photoFilename,
|
||||
photoConsent: registrationData.photoConsent,
|
||||
dateOfBirth: registrationData.dateOfBirth,
|
||||
birthCity: registrationData.birthCity,
|
||||
@@ -42,10 +32,11 @@ class _AmRegisterStep2ScreenState extends State<AmRegisterStep2Screen> {
|
||||
cardColor: CardColorHorizontal.green,
|
||||
initialData: initialData,
|
||||
previousRoute: '/am-register-step1',
|
||||
onPickPhoto: _pickPhoto,
|
||||
onSubmit: (data) {
|
||||
registrationData.updateProfessionalInfo(
|
||||
photoPath: _photoPathFramework ?? data.photoPath,
|
||||
photoPath: data.photoPath,
|
||||
photoBytes: data.photoBytes,
|
||||
photoFilename: data.photoFilename,
|
||||
photoConsent: data.photoConsent,
|
||||
dateOfBirth: data.dateOfBirth,
|
||||
birthCity: data.birthCity,
|
||||
@@ -58,4 +49,4 @@ class _AmRegisterStep2ScreenState extends State<AmRegisterStep2Screen> {
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,8 +196,9 @@ class _AmRegisterStep4ScreenState extends State<AmRegisterStep4Screen> {
|
||||
title: 'Informations professionnelles',
|
||||
cardColor: CardColorHorizontal.green,
|
||||
initialData: ProfessionalInfoData(
|
||||
// TODO: Gérer photoPath vs photoFile correctement
|
||||
photoPath: null, // Pas d'accès facile au fichier ici, on verra
|
||||
photoPath: data.photoPath,
|
||||
photoBytes: data.photoBytes,
|
||||
photoFilename: data.photoFilename,
|
||||
dateOfBirth: data.dateOfBirth,
|
||||
birthCity: data.birthCity,
|
||||
birthCountry: data.birthCountry,
|
||||
|
||||
Reference in New Issue
Block a user