From 813fdb8449e48100b9b52cf4aa4b04ee8c15fbe3 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Sun, 8 Feb 2026 12:33:48 +0100 Subject: [PATCH] =?UTF-8?q?fix(#83):=20Corriger=20le=20style=20du=20bouton?= =?UTF-8?q?=20Pr=C3=A9c=C3=A9dent=20et=20ajuster=20les=20tailles=20d'ic?= =?UTF-8?q?=C3=B4nes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Utilise CustomNavigationButton avec HoverReliefWidget pour le bouton Précédent en mode mobile, assurant la cohérence visuelle avec les autres écrans. Augmente également la taille des icônes de choix (140px mobile, 170px desktop). Co-authored-by: Cursor --- .../screens/auth/register_choice_screen.dart | 67 +++++++++---------- frontend/lib/widgets/choice_card_widget.dart | 4 +- 2 files changed, 34 insertions(+), 37 deletions(-) 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),