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: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');
}
},
),
),
],

View File

@ -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),