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 createState() => _AmRegisterStep2ScreenState(); } class _AmRegisterStep2ScreenState extends State { String? _photoPathFramework; Future _pickPhoto() async { // TODO: brancher ImagePicker ; ne pas préremplir de chemin factice } @override Widget build(BuildContext context) { final registrationData = Provider.of(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'); }, ); } }