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:
parent
155c6ca4d5
commit
813fdb8449
@ -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(
|
||||||
@ -42,10 +39,7 @@ class RegisterChoiceScreen extends StatelessWidget {
|
|||||||
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()) {
|
||||||
@ -135,20 +129,27 @@ 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(
|
||||||
|
width: double.infinity,
|
||||||
|
child: AspectRatio(
|
||||||
|
aspectRatio: 2 / 3,
|
||||||
|
child: ChoiceCardWidget(
|
||||||
isMobile: true,
|
isMobile: true,
|
||||||
onParentSelected: () => context.go('/parent-register-step1'),
|
onParentSelected: () => context.go('/parent-register-step1'),
|
||||||
onAmSelected: () => context.go('/am-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: HoverReliefWidget(
|
|
||||||
child: CustomNavigationButton(
|
child: CustomNavigationButton(
|
||||||
text: 'Précédent',
|
text: 'Précédent',
|
||||||
style: NavigationButtonStyle.purple,
|
style: NavigationButtonStyle.purple,
|
||||||
|
width: double.infinity,
|
||||||
|
height: 50,
|
||||||
|
fontSize: 16,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (context.canPop()) {
|
if (context.canPop()) {
|
||||||
context.pop();
|
context.pop();
|
||||||
@ -156,10 +157,6 @@ class RegisterChoiceScreen extends StatelessWidget {
|
|||||||
context.go('/login');
|
context.go('/login');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
width: double.infinity,
|
|
||||||
height: 50,
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -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),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user