diff --git a/frontend/lib/screens/auth/register_choice_screen.dart b/frontend/lib/screens/auth/register_choice_screen.dart index 301814c..d40c3b7 100644 --- a/frontend/lib/screens/auth/register_choice_screen.dart +++ b/frontend/lib/screens/auth/register_choice_screen.dart @@ -1,12 +1,12 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'dart:math' as math; // Pour la rotation du chevron -import '../../widgets/choice_card_widget.dart'; // Import du nouveau widget -import '../../widgets/custom_navigation_button.dart'; +import 'dart:math' as math; +import '../../widgets/choice_card_widget.dart'; import '../../widgets/hover_relief_widget.dart'; +import '../../widgets/custom_navigation_button.dart'; +import '../../models/card_assets.dart'; import 'package:go_router/go_router.dart'; -// Screen for choosing between Parent and AM registration class RegisterChoiceScreen extends StatelessWidget { const RegisterChoiceScreen({super.key}); @@ -18,9 +18,6 @@ class RegisterChoiceScreen extends StatelessWidget { final width = constraints.maxWidth; final height = constraints.maxHeight; final screenSize = Size(width, height); - - // Utilisation de la largeur disponible pour déterminer le mode - // C'est plus fiable que MediaQuery si le widget est contraint final isMobile = width < 900; return Stack( @@ -41,11 +38,8 @@ class RegisterChoiceScreen extends StatelessWidget { left: 40, child: IconButton( icon: Transform.flip( - flipX: true, - child: Image.asset( - 'assets/images/chevron_right.png', - height: 40 - ) + flipX: true, + child: Image.asset('assets/images/chevron_right.png', height: 40), ), onPressed: () { if (context.canPop()) { @@ -92,7 +86,7 @@ class RegisterChoiceScreen extends StatelessWidget { ), // Espace entre les deux parties SizedBox(width: screenSize.width * 0.05), - + // Partie Droite: Carte rose avec les boutons Expanded( flex: 1, @@ -135,31 +129,34 @@ class RegisterChoiceScreen extends StatelessWidget { textAlign: TextAlign.center, ), const SizedBox(height: 30), - // Carte rose verticale adaptative - ChoiceCardWidget( - isMobile: true, - onParentSelected: () => context.go('/parent-register-step1'), - onAmSelected: () => context.go('/am-register-step1'), + // Carte rose verticale + SizedBox( + width: double.infinity, + child: AspectRatio( + aspectRatio: 2 / 3, + child: ChoiceCardWidget( + isMobile: true, + onParentSelected: () => context.go('/parent-register-step1'), + onAmSelected: () => context.go('/am-register-step1'), + ), + ), ), const SizedBox(height: 30), // Bouton Précédent - SizedBox( - width: double.infinity, - child: HoverReliefWidget( - child: CustomNavigationButton( - text: 'Précédent', - style: NavigationButtonStyle.purple, - onPressed: () { - if (context.canPop()) { - context.pop(); - } else { - context.go('/login'); - } - }, - width: double.infinity, - height: 50, - fontSize: 16, - ), + HoverReliefWidget( + child: CustomNavigationButton( + text: 'Précédent', + style: NavigationButtonStyle.purple, + width: double.infinity, + height: 50, + fontSize: 16, + onPressed: () { + if (context.canPop()) { + context.pop(); + } else { + context.go('/login'); + } + }, ), ), ], diff --git a/frontend/lib/widgets/choice_card_widget.dart b/frontend/lib/widgets/choice_card_widget.dart index 02041cb..ecb418e 100644 --- a/frontend/lib/widgets/choice_card_widget.dart +++ b/frontend/lib/widgets/choice_card_widget.dart @@ -3,7 +3,7 @@ import 'package:google_fonts/google_fonts.dart'; import '../models/card_assets.dart'; import 'hover_relief_widget.dart'; -// Widget for the registration choice card (Parent vs AM) +/// Widget réutilisable pour la carte de choix Parent/AM class ChoiceCardWidget extends StatelessWidget { final VoidCallback onParentSelected; final VoidCallback onAmSelected; @@ -68,7 +68,7 @@ class ChoiceCardWidget extends StatelessWidget { hoverShadowColor: hoverShadow, child: Padding( padding: EdgeInsets.all(isMobile ? 6.0 : 8.0), - child: Image.asset(iconPath, height: isMobile ? 100 : 140), + child: Image.asset(iconPath, height: isMobile ? 140 : 170), ), ), SizedBox(height: isMobile ? 10 : 15),