- 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
53 lines
1.8 KiB
Dart
53 lines
1.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import '../../models/am_registration_data.dart';
|
|
import '../../models/card_assets.dart';
|
|
import '../../widgets/professional_info_form_screen.dart';
|
|
|
|
class AmRegisterStep2Screen extends StatelessWidget {
|
|
const AmRegisterStep2Screen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final registrationData = Provider.of<AmRegistrationData>(context, listen: false);
|
|
|
|
final initialData = ProfessionalInfoData(
|
|
photoPath: registrationData.photoPath,
|
|
photoBytes: registrationData.photoBytes,
|
|
photoFilename: registrationData.photoFilename,
|
|
photoConsent: registrationData.photoConsent,
|
|
dateOfBirth: registrationData.dateOfBirth,
|
|
birthCity: registrationData.birthCity,
|
|
birthCountry: registrationData.birthCountry,
|
|
nir: registrationData.nir,
|
|
agrementNumber: registrationData.agrementNumber,
|
|
capacity: registrationData.capacity,
|
|
);
|
|
|
|
return ProfessionalInfoFormScreen(
|
|
stepText: 'Étape 2/4',
|
|
title: 'Vos informations professionnelles',
|
|
cardColor: CardColorHorizontal.green,
|
|
initialData: initialData,
|
|
previousRoute: '/am-register-step1',
|
|
onSubmit: (data) {
|
|
registrationData.updateProfessionalInfo(
|
|
photoPath: data.photoPath,
|
|
photoBytes: data.photoBytes,
|
|
photoFilename: data.photoFilename,
|
|
photoConsent: data.photoConsent,
|
|
dateOfBirth: data.dateOfBirth,
|
|
birthCity: data.birthCity,
|
|
birthCountry: data.birthCountry,
|
|
nir: data.nir,
|
|
agrementNumber: data.agrementNumber,
|
|
capacity: data.capacity,
|
|
);
|
|
context.go('/am-register-step3');
|
|
},
|
|
);
|
|
}
|
|
}
|