import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:go_router/go_router.dart'; import '../../models/user_registration_data.dart'; import '../../widgets/presentation_form_screen.dart'; import '../../models/card_assets.dart'; import '../../utils/data_generator.dart'; class ParentRegisterStep4Screen extends StatelessWidget { const ParentRegisterStep4Screen({super.key}); @override Widget build(BuildContext context) { final registrationData = Provider.of(context, listen: false); // Générer un texte de test si vide String initialText = registrationData.motivationText; bool initialCgu = registrationData.cguAccepted; if (initialText.isEmpty) { initialText = DataGenerator.motivation(); initialCgu = true; } return PresentationFormScreen( stepText: 'Étape 4/5', title: 'Motivation de votre demande', cardColor: CardColorHorizontal.green, textFieldHint: 'Écrivez ici pour motiver votre demande...', initialText: initialText, initialCguAccepted: initialCgu, previousRoute: '/parent-register-step3', onSubmit: (text, cguAccepted) { registrationData.updateMotivation(text); registrationData.acceptCGU(cguAccepted); // Les infos financières peuvent être gérées ailleurs si nécessaire context.go('/parent-register-step5'); }, ); } }