petitspas/frontend/lib/screens/auth/am_register_step2_screen.dart
Julien Martin 58607cdbc9 feat(inscription AM #120): UI étape pro, photo unifiée, scripts et données test
- Panneau AM : validation NIR alignée API, date d’agrément requise côté app,
  capacité 1–10, n° agrément + date sur une ligne, ville/pays formatés au blur.
- Widget RegistrationPhotoSlot (cadre, croix) partagé avec les cartes enfant.
- AuthService : MIME PNG/JPEG pour la photo ; payload date_agrement.
- Scripts register-am-dubois / mansouri ; chemins tests/ressources/photos ;
  doc test-data + seed ; smoke curl inscription AM.

Made-with: Cursor
2026-04-13 13:19:32 +02:00

55 lines
1.9 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,
agreementDate: registrationData.agreementDate,
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,
agreementDate: data.agreementDate,
capacity: data.capacity,
);
context.go('/am-register-step3');
},
);
}
}