fix(#83): Corriger le style du bouton Précédent et ajuster les tailles d'icônes

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 <cursoragent@cursor.com>
This commit is contained in:
MARTIN Julien 2026-02-08 12:33:48 +01:00
parent 155c6ca4d5
commit 813fdb8449
2 changed files with 34 additions and 37 deletions

View File

@ -1,12 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'dart:math' as math; // Pour la rotation du chevron import 'dart:math' as math;
import '../../widgets/choice_card_widget.dart'; // Import du nouveau widget import '../../widgets/choice_card_widget.dart';
import '../../widgets/custom_navigation_button.dart';
import '../../widgets/hover_relief_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'; import 'package:go_router/go_router.dart';
// Screen for choosing between Parent and AM registration
class RegisterChoiceScreen extends StatelessWidget { class RegisterChoiceScreen extends StatelessWidget {
const RegisterChoiceScreen({super.key}); const RegisterChoiceScreen({super.key});
@ -18,9 +18,6 @@ class RegisterChoiceScreen extends StatelessWidget {
final width = constraints.maxWidth; final width = constraints.maxWidth;
final height = constraints.maxHeight; final height = constraints.maxHeight;
final screenSize = Size(width, height); 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; final isMobile = width < 900;
return Stack( return Stack(
@ -41,11 +38,8 @@ class RegisterChoiceScreen extends StatelessWidget {
left: 40, left: 40,
child: IconButton( child: IconButton(
icon: Transform.flip( icon: Transform.flip(
flipX: true, flipX: true,
child: Image.asset( child: Image.asset('assets/images/chevron_right.png', height: 40),
'assets/images/chevron_right.png',
height: 40
)
), ),
onPressed: () { onPressed: () {
if (context.canPop()) { if (context.canPop()) {
@ -92,7 +86,7 @@ class RegisterChoiceScreen extends StatelessWidget {
), ),
// Espace entre les deux parties // Espace entre les deux parties
SizedBox(width: screenSize.width * 0.05), SizedBox(width: screenSize.width * 0.05),
// Partie Droite: Carte rose avec les boutons // Partie Droite: Carte rose avec les boutons
Expanded( Expanded(
flex: 1, flex: 1,
@ -135,31 +129,34 @@ class RegisterChoiceScreen extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
// Carte rose verticale adaptative // Carte rose verticale
ChoiceCardWidget( SizedBox(
isMobile: true, width: double.infinity,
onParentSelected: () => context.go('/parent-register-step1'), child: AspectRatio(
onAmSelected: () => context.go('/am-register-step1'), aspectRatio: 2 / 3,
child: ChoiceCardWidget(
isMobile: true,
onParentSelected: () => context.go('/parent-register-step1'),
onAmSelected: () => context.go('/am-register-step1'),
),
),
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
// Bouton Précédent // Bouton Précédent
SizedBox( HoverReliefWidget(
width: double.infinity, child: CustomNavigationButton(
child: HoverReliefWidget( text: 'Précédent',
child: CustomNavigationButton( style: NavigationButtonStyle.purple,
text: 'Précédent', width: double.infinity,
style: NavigationButtonStyle.purple, height: 50,
onPressed: () { fontSize: 16,
if (context.canPop()) { onPressed: () {
context.pop(); if (context.canPop()) {
} else { context.pop();
context.go('/login'); } else {
} context.go('/login');
}, }
width: double.infinity, },
height: 50,
fontSize: 16,
),
), ),
), ),
], ],

View File

@ -3,7 +3,7 @@ import 'package:google_fonts/google_fonts.dart';
import '../models/card_assets.dart'; import '../models/card_assets.dart';
import 'hover_relief_widget.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 { class ChoiceCardWidget extends StatelessWidget {
final VoidCallback onParentSelected; final VoidCallback onParentSelected;
final VoidCallback onAmSelected; final VoidCallback onAmSelected;
@ -68,7 +68,7 @@ class ChoiceCardWidget extends StatelessWidget {
hoverShadowColor: hoverShadow, hoverShadowColor: hoverShadow,
child: Padding( child: Padding(
padding: EdgeInsets.all(isMobile ? 6.0 : 8.0), 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), SizedBox(height: isMobile ? 10 : 15),