feat(onboarding): UI/UX polish + mapping typeOrg + gestion erreur paiement Wave
Plan selection :
- Grille 2×2 compacte pour les plages (au lieu de liste verticale)
- Badge ⭐ POPULAIRE sur STANDARD
- Remise annuelle affichée (−X%/an)
- AnimatedSwitcher + auto-scroll vers formules quand plage sélectionnée
- Dark mode adaptatif complet
Récapitulatif :
- Dark mode complet (AppColors pairs)
- Bloc Total gradient gold adaptatif
- NoteBox avec backgrounds accent.withOpacity()
- Utilise OnboardingBottomBar (consistence)
Payment method :
- Dark mode + couleurs de marque Wave/Orange hardcodées (intentionnel)
- Logo container reste blanc (brand)
- Mapping typeOrganisation détaillé → enum backend ASSOCIATION/MUTUELLE/
COOPERATIVE/FEDERATION (fix HTTP 400 'Valeur invalide pour typeOrganisation')
Wave payment :
- Dark mode adaptatif
- Message dev clair (simulation automatique)
- Gestion OnboardingPaiementEchoue : SnackBar rouge + reset flags + reste sur page
(plus de faux succès quand confirmerPaiement() return false ou lève exception)
Bloc : nouvel état OnboardingPaiementEchoue, _onRetourDepuisWave vérifie le return
de confirmerPaiement() (plus de catch silencieux qui émettait OnboardingPaiementConfirme)
Shared widgets : OnboardingSectionTitle + OnboardingBottomBar dark mode + hint optionnel
This commit is contained in:
@@ -4,6 +4,7 @@ import '../../bloc/onboarding_bloc.dart';
|
||||
import '../../../../core/di/injection.dart';
|
||||
import '../../../../features/authentication/presentation/bloc/auth_bloc.dart';
|
||||
import '../../../../shared/design_system/tokens/unionflow_colors.dart';
|
||||
import '../../../../shared/design_system/tokens/app_colors.dart';
|
||||
import 'plan_selection_page.dart';
|
||||
import 'period_selection_page.dart';
|
||||
import 'subscription_summary_page.dart';
|
||||
@@ -57,7 +58,7 @@ class _OnboardingFlowView extends StatelessWidget {
|
||||
builder: (context, state) {
|
||||
if (state is OnboardingLoading || state is OnboardingInitial || state is OnboardingPaiementConfirme) {
|
||||
return Scaffold(
|
||||
backgroundColor: UnionFlowColors.background,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -83,7 +84,7 @@ class _OnboardingFlowView extends StatelessWidget {
|
||||
|
||||
if (state is OnboardingError) {
|
||||
return Scaffold(
|
||||
backgroundColor: UnionFlowColors.background,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
body: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
@@ -115,7 +116,7 @@ class _OnboardingFlowView extends StatelessWidget {
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: UnionFlowColors.unionGreen,
|
||||
foregroundColor: Colors.white,
|
||||
foregroundColor: AppColors.onPrimary,
|
||||
),
|
||||
child: const Text('Réessayer'),
|
||||
),
|
||||
@@ -153,6 +154,14 @@ class _OnboardingFlowView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
// Échec de confirmation — retourne à la page Wave avec le SnackBar d'erreur
|
||||
if (state is OnboardingPaiementEchoue) {
|
||||
return WavePaymentPage(
|
||||
souscription: state.souscription,
|
||||
waveLaunchUrl: state.waveLaunchUrl,
|
||||
);
|
||||
}
|
||||
|
||||
if (state is OnboardingStepAttente) {
|
||||
return AwaitingValidationPage(souscription: state.souscription);
|
||||
}
|
||||
@@ -176,7 +185,7 @@ class _RejectedPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: UnionFlowColors.background,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(32),
|
||||
@@ -247,7 +256,7 @@ class _RejectedPage extends StatelessWidget {
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: UnionFlowColors.unionGreen,
|
||||
foregroundColor: Colors.white,
|
||||
foregroundColor: AppColors.onPrimary,
|
||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
|
||||
Reference in New Issue
Block a user