import 'package:flutter/material.dart'; import '../../../../shared/design_system/tokens/unionflow_colors.dart'; /// Header commun à toutes les étapes d'onboarding class OnboardingStepHeader extends StatelessWidget { final int step; final int total; final String title; final String subtitle; const OnboardingStepHeader({ super.key, required this.step, required this.total, required this.title, required this.subtitle, }); @override Widget build(BuildContext context) { return Container( decoration: const BoxDecoration( gradient: UnionFlowColors.primaryGradient, ), child: SafeArea( bottom: false, child: Padding( padding: const EdgeInsets.fromLTRB(20, 12, 20, 24), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: List.generate(total, (i) { final done = i < step; return Expanded( child: Container( height: 4, margin: EdgeInsets.only(right: i < total - 1 ? 6 : 0), decoration: BoxDecoration( color: done ? Colors.white : Colors.white.withOpacity(0.3), borderRadius: BorderRadius.circular(2), ), ), ); }), ), const SizedBox(height: 6), Text( 'Étape $step sur $total', style: TextStyle( color: Colors.white.withOpacity(0.75), fontSize: 12, fontWeight: FontWeight.w500, ), ), const SizedBox(height: 12), Text( title, style: const TextStyle( color: Colors.white, fontSize: 22, fontWeight: FontWeight.w800, ), ), const SizedBox(height: 4), Text( subtitle, style: TextStyle( color: Colors.white.withOpacity(0.8), fontSize: 13, height: 1.4, ), ), ], ), ), ), ); } } /// Titre de section avec icône class OnboardingSectionTitle extends StatelessWidget { final IconData icon; final String title; const OnboardingSectionTitle({ super.key, required this.icon, required this.title, }); @override Widget build(BuildContext context) { return Row( children: [ Icon(icon, color: UnionFlowColors.unionGreen, size: 20), const SizedBox(width: 8), Text( title, style: const TextStyle( color: UnionFlowColors.textPrimary, fontWeight: FontWeight.w700, fontSize: 16, ), ), ], ); } } /// Barre de bouton principale en bas de page class OnboardingBottomBar extends StatelessWidget { final bool enabled; final String label; final VoidCallback onPressed; const OnboardingBottomBar({ super.key, required this.enabled, required this.label, required this.onPressed, }); @override Widget build(BuildContext context) { return Container( padding: EdgeInsets.fromLTRB( 20, 12, 20, MediaQuery.of(context).padding.bottom + 12), decoration: BoxDecoration( color: UnionFlowColors.surface, boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.08), blurRadius: 12, offset: const Offset(0, -4), ), ], ), child: SizedBox( width: double.infinity, child: ElevatedButton( onPressed: enabled ? onPressed : null, style: ElevatedButton.styleFrom( backgroundColor: UnionFlowColors.unionGreen, disabledBackgroundColor: UnionFlowColors.border, foregroundColor: Colors.white, padding: const EdgeInsets.symmetric(vertical: 15), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(14), ), elevation: enabled ? 2 : 0, shadowColor: UnionFlowColors.unionGreen.withOpacity(0.4), ), child: Text( label, style: const TextStyle( fontSize: 16, fontWeight: FontWeight.w700, letterSpacing: 0.3, ), ), ), ), ); } }