- Parcours AM : plus de jeu de test Marie DUBOIS ni photo factice - Parcours parent : plus de DataGenerator ; enfants vides à l’ajout - Suppression de data_generator.dart (inutilisé) Made-with: Cursor
61 lines
2.0 KiB
Dart
61 lines
2.0 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 StatefulWidget {
|
|
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(
|
|
photoPath: registrationData.photoPath,
|
|
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',
|
|
onPickPhoto: _pickPhoto,
|
|
onSubmit: (data) {
|
|
registrationData.updateProfessionalInfo(
|
|
photoPath: _photoPathFramework ?? data.photoPath,
|
|
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');
|
|
},
|
|
);
|
|
}
|
|
} |