feat: WebSocket temps réel + Finance Workflow + corrections

- Task #6: WebSocket /ws/dashboard + Kafka events (5 topics)
  * Backend: KafkaEventProducer, KafkaEventConsumer
  * Mobile: WebSocketService (reconnection, heartbeat, typed events)
  * DashboardBloc: Auto-refresh depuis WebSocket events

- Finance Workflow: approbations + budgets (backend + mobile)
  * Backend: entities, services, resources, migrations Flyway V6
  * Mobile: features finance_workflow complète avec BLoC

- Corrections DI: interfaces IRepository partout
  * IProfileRepository, IOrganizationRepository, IMembreRepository
  * GetIt configuré avec @injectable

- Spec-Kit: constitution + templates mis à jour
  * .specify/memory/constitution.md enrichie
  * Templates agent, plan, spec, tasks, checklist

- Nettoyage: fichiers temporaires supprimés

Signed-off-by: lions dev Team
This commit is contained in:
dahoud
2026-03-15 02:12:17 +00:00
parent bbc409de9d
commit e8ad874015
635 changed files with 58160 additions and 20674 deletions

View File

@@ -1,8 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart' show defaultTargetPlatform, TargetPlatform, kIsWeb;
import 'package:package_info_plus/package_info_plus.dart';
import 'package:share_plus/share_plus.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../../shared/design_system/tokens/color_tokens.dart';
import '../../../../shared/design_system/tokens/spacing_tokens.dart';
import '../../../../shared/design_system/unionflow_design_system.dart';
import '../../../../shared/widgets/core_card.dart';
import '../../../../shared/widgets/info_badge.dart';
/// Page À propos - UnionFlow Mobile
@@ -35,9 +38,18 @@ class _AboutPageState extends State<AboutPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFF8F9FA),
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: UFAppBar(
title: 'À PROPOS',
actions: [
IconButton(
icon: const Icon(Icons.share_outlined, size: 20),
onPressed: _shareApp,
),
],
),
body: SingleChildScrollView(
padding: const EdgeInsets.all(12),
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -70,62 +82,39 @@ class _AboutPageState extends State<AboutPage> {
);
}
/// Header harmonisé avec le design system
/// Header épuré
Widget _buildHeader() {
return Container(
padding: const EdgeInsets.all(SpacingTokens.xl),
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: ColorTokens.primaryGradient,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(SpacingTokens.xl),
boxShadow: [
BoxShadow(
color: ColorTokens.primary.withOpacity(0.3),
blurRadius: 20,
offset: const Offset(0, 8),
),
],
),
child: Row(
return Center(
child: Column(
children: [
Container(
padding: const EdgeInsets.all(12),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(12),
color: AppColors.primaryGreen.withOpacity(0.1),
borderRadius: BorderRadius.circular(20),
),
child: const Icon(
Icons.info,
color: Colors.white,
size: 24,
Icons.account_balance,
color: AppColors.primaryGreen,
size: 48,
),
),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'À propos de UnionFlow',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
Text(
'Version et informations de l\'application',
style: TextStyle(
fontSize: 14,
color: Colors.white.withOpacity(0.8),
),
),
],
),
const SizedBox(height: 16),
Text(
'UNIONFLOW MOBILE',
style: AppTypography.headerSmall.copyWith(fontWeight: FontWeight.bold, letterSpacing: 1.2),
),
Text(
'Gestion d\'associations et syndicats',
style: AppTypography.subtitleSmall,
),
const SizedBox(height: 8),
if (_packageInfo != null)
InfoBadge(
text: 'VERSION ${_packageInfo!.version}',
backgroundColor: AppColors.lightSurface,
textColor: AppColors.textSecondaryLight,
),
],
),
);
@@ -133,91 +122,18 @@ class _AboutPageState extends State<AboutPage> {
/// Section informations de l'application
Widget _buildAppInfoSection() {
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
return CoreCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(
Icons.mobile_friendly,
color: Colors.grey[600],
size: 20,
),
const SizedBox(width: 8),
Text(
'Informations de l\'application',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.grey[800],
),
),
],
Text(
'INFORMATIONS',
style: AppTypography.subtitleSmall.copyWith(fontWeight: FontWeight.bold, letterSpacing: 1.1),
),
const SizedBox(height: 16),
// Logo et nom de l'app
Center(
child: Column(
children: [
Container(
width: 80,
height: 80,
decoration: BoxDecoration(
gradient: const LinearGradient(
colors: ColorTokens.primaryGradient,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(SpacingTokens.xxl),
),
child: const Icon(
Icons.account_balance,
color: Colors.white,
size: 40,
),
),
const SizedBox(height: 12),
const Text(
'UnionFlow Mobile',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: Color(0xFF1F2937),
),
),
const SizedBox(height: 4),
Text(
'Gestion d\'associations et syndicats',
style: TextStyle(
fontSize: 14,
color: Colors.grey[600],
),
),
],
),
),
const SizedBox(height: 20),
// Informations techniques
_buildInfoRow('Version', _packageInfo?.version ?? 'Chargement...'),
_buildInfoRow('Build', _packageInfo?.buildNumber ?? 'Chargement...'),
_buildInfoRow('Package', _packageInfo?.packageName ?? 'Chargement...'),
_buildInfoRow('Plateforme', 'Android/iOS'),
const SizedBox(height: 12),
_buildInfoRow('Construction', _packageInfo?.buildNumber ?? '...'),
_buildInfoRow('Package', _packageInfo?.packageName ?? '...'),
_buildInfoRow('Plateforme', 'Android / iOS'),
_buildInfoRow('Framework', 'Flutter 3.x'),
],
),
@@ -227,26 +143,18 @@ class _AboutPageState extends State<AboutPage> {
/// Ligne d'information
Widget _buildInfoRow(String label, String value) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 4),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
label,
style: TextStyle(
fontSize: 14,
color: Colors.grey[600],
fontWeight: FontWeight.w500,
),
style: AppTypography.bodyTextSmall.copyWith(color: AppColors.textSecondaryLight),
),
Flexible(
child: Text(
value,
style: const TextStyle(
fontSize: 14,
color: Color(0xFF1F2937),
fontWeight: FontWeight.w600,
),
style: AppTypography.actionText.copyWith(fontSize: 12),
textAlign: TextAlign.end,
),
),
@@ -257,59 +165,26 @@ class _AboutPageState extends State<AboutPage> {
/// Section équipe de développement
Widget _buildTeamSection() {
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
return CoreCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(
Icons.group,
color: Colors.grey[600],
size: 20,
),
const SizedBox(width: 8),
Text(
'Équipe de développement',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.grey[800],
),
),
],
Text(
'ÉQUIPE',
style: AppTypography.subtitleSmall.copyWith(fontWeight: FontWeight.bold, letterSpacing: 1.1),
),
const SizedBox(height: 16),
const SizedBox(height: 12),
_buildTeamMember(
'UnionFlow Team',
'Développement & Architecture',
'Architecture & Dev',
Icons.code,
ColorTokens.primary,
AppColors.primaryGreen,
),
_buildTeamMember(
'Design System',
'Interface utilisateur & UX',
'UI / UX Focus',
Icons.design_services,
ColorTokens.info,
),
_buildTeamMember(
'Support Technique',
'Maintenance & Support',
Icons.support_agent,
ColorTokens.success,
AppColors.info,
),
],
),
@@ -319,41 +194,24 @@ class _AboutPageState extends State<AboutPage> {
/// Membre de l'équipe
Widget _buildTeamMember(String name, String role, IconData icon, Color color) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 6),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(6),
decoration: BoxDecoration(
color: color.withOpacity(0.1),
borderRadius: BorderRadius.circular(8),
),
child: Icon(
icon,
color: color,
size: 20,
),
child: Icon(icon, color: color, size: 16),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFF1F2937),
),
),
Text(
role,
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
),
),
Text(name, style: AppTypography.actionText.copyWith(fontSize: 12)),
Text(role, style: AppTypography.subtitleSmall.copyWith(fontSize: 10)),
],
),
),
@@ -364,72 +222,19 @@ class _AboutPageState extends State<AboutPage> {
/// Section fonctionnalités
Widget _buildFeaturesSection() {
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
return CoreCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(
Icons.featured_play_list,
color: Colors.grey[600],
size: 20,
),
const SizedBox(width: 8),
Text(
'Fonctionnalités principales',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.grey[800],
),
),
],
),
const SizedBox(height: 16),
_buildFeatureItem(
'Gestion des membres',
'Administration complète des adhérents',
Icons.people,
ColorTokens.primary,
),
_buildFeatureItem(
'Organisations',
'Gestion des syndicats et fédérations',
Icons.business,
ColorTokens.info,
),
_buildFeatureItem(
'Événements',
'Planification et suivi des événements',
Icons.event,
ColorTokens.success,
),
_buildFeatureItem(
'Tableau de bord',
'Statistiques et métriques en temps réel',
Icons.dashboard,
ColorTokens.warning,
),
_buildFeatureItem(
'Authentification sécurisée',
'Connexion via Keycloak OIDC',
Icons.security,
ColorTokens.tertiary,
Text(
'FONCTIONNALITÉS',
style: AppTypography.subtitleSmall.copyWith(fontWeight: FontWeight.bold, letterSpacing: 1.1),
),
const SizedBox(height: 12),
_buildFeatureItem('Membres', 'Administration complète', Icons.people, AppColors.primaryGreen),
_buildFeatureItem('Organisations', 'Syndicats & Fédérations', Icons.business, AppColors.info),
_buildFeatureItem('Événements', 'Planification & Suivi', Icons.event, AppColors.success),
_buildFeatureItem('Sécurité', 'Auth Keycloak OIDC', Icons.security, AppColors.warning),
],
),
);
@@ -438,41 +243,17 @@ class _AboutPageState extends State<AboutPage> {
/// Élément de fonctionnalité
Widget _buildFeatureItem(String title, String description, IconData icon, Color color) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
padding: const EdgeInsets.symmetric(vertical: 6),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: color.withOpacity(0.1),
borderRadius: BorderRadius.circular(8),
),
child: Icon(
icon,
color: color,
size: 20,
),
),
Icon(icon, color: color, size: 16),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFF1F2937),
),
),
Text(
description,
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
),
),
Text(title, style: AppTypography.actionText.copyWith(fontSize: 12)),
Text(description, style: AppTypography.subtitleSmall.copyWith(fontSize: 10)),
],
),
),
@@ -483,66 +264,19 @@ class _AboutPageState extends State<AboutPage> {
/// Section liens utiles
Widget _buildLinksSection() {
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
return CoreCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(
Icons.link,
color: Colors.grey[600],
size: 20,
),
const SizedBox(width: 8),
Text(
'Liens utiles',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.grey[800],
),
),
],
),
const SizedBox(height: 16),
_buildLinkItem(
'Site web officiel',
'https://unionflow.com',
Icons.web,
() => _launchUrl('https://unionflow.com'),
),
_buildLinkItem(
'Documentation',
'Guide d\'utilisation complet',
Icons.book,
() => _launchUrl('https://docs.unionflow.com'),
),
_buildLinkItem(
'Code source',
'Projet open source sur GitHub',
Icons.code,
() => _launchUrl('https://github.com/unionflow/unionflow'),
),
_buildLinkItem(
'Politique de confidentialité',
'Protection de vos données',
Icons.privacy_tip,
() => _launchUrl('https://unionflow.com/privacy'),
Text(
'LIENS UTILES',
style: AppTypography.subtitleSmall.copyWith(fontWeight: FontWeight.bold, letterSpacing: 1.1),
),
const SizedBox(height: 12),
_buildLinkItem('Site Web', 'https://unionflow.com', Icons.web, () => _launchUrl('https://unionflow.com')),
_buildLinkItem('Documentation', 'Guide d\'utilisation', Icons.book, () => _launchUrl('https://docs.unionflow.com')),
_buildLinkItem('Confidentialité', 'Protection des données', Icons.privacy_tip, () => _launchUrl('https://unionflow.com/privacy')),
_buildLinkItem('Évaluer l\'app', 'Noter sur le store', Icons.star, _showRatingDialog),
],
),
);
@@ -552,143 +286,48 @@ class _AboutPageState extends State<AboutPage> {
Widget _buildLinkItem(String title, String subtitle, IconData icon, VoidCallback onTap) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(4),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 4),
padding: const EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(SpacingTokens.md),
decoration: BoxDecoration(
color: ColorTokens.primary.withOpacity(0.1),
borderRadius: BorderRadius.circular(SpacingTokens.md),
),
child: Icon(
icon,
color: ColorTokens.primary,
size: 20,
),
),
const SizedBox(width: SpacingTokens.lg),
Icon(icon, color: AppColors.primaryGreen, size: 16),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFF1F2937),
),
),
Text(
subtitle,
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
),
),
Text(title, style: AppTypography.actionText.copyWith(fontSize: 12)),
Text(subtitle, style: AppTypography.subtitleSmall.copyWith(fontSize: 10)),
],
),
),
Icon(
Icons.arrow_forward_ios,
color: Colors.grey[400],
size: 16,
),
const Icon(Icons.chevron_right, color: AppColors.textSecondaryLight, size: 14),
],
),
),
);
}
/// Section support et contact
/// Section support
Widget _buildSupportSection() {
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
return CoreCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(
Icons.support_agent,
color: Colors.grey[600],
size: 20,
),
const SizedBox(width: 8),
Text(
'Support et contact',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.grey[800],
),
),
],
Text(
'SUPPORT',
style: AppTypography.subtitleSmall.copyWith(fontWeight: FontWeight.bold, letterSpacing: 1.1),
),
const SizedBox(height: 16),
_buildSupportItem(
'Support technique',
'support@unionflow.com',
Icons.email,
() => _launchUrl('mailto:support@unionflow.com'),
),
_buildSupportItem(
'Signaler un bug',
'Rapporter un problème technique',
Icons.bug_report,
() => _showBugReportDialog(),
),
_buildSupportItem(
'Suggérer une amélioration',
'Proposer de nouvelles fonctionnalités',
Icons.lightbulb,
() => _showFeatureRequestDialog(),
),
_buildSupportItem(
'Évaluer l\'application',
'Donner votre avis sur les stores',
Icons.star,
() => _showRatingDialog(),
),
const SizedBox(height: 20),
// Copyright et mentions légales
Center(
const SizedBox(height: 12),
_buildSupportItem('Email', 'support@unionflow.com', Icons.email, () => _launchUrl('mailto:support@unionflow.com')),
_buildSupportItem('Bug', 'Signaler un problème', Icons.bug_report, () => _showBugReportDialog()),
const SizedBox(height: 24),
const Center(
child: Column(
children: [
Text(
'© 2024 UnionFlow. Tous droits réservés.',
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
),
textAlign: TextAlign.center,
),
const SizedBox(height: 4),
Text(
'Développé avec ❤️ pour les organisations syndicales',
style: TextStyle(
fontSize: 12,
color: Colors.grey[500],
),
textAlign: TextAlign.center,
),
Text('© 2024 UNIONFLOW', style: AppTypography.badgeText),
Text('Fait avec ❤️ pour les syndicats', style: AppTypography.subtitleSmall),
],
),
),
@@ -701,51 +340,23 @@ class _AboutPageState extends State<AboutPage> {
Widget _buildSupportItem(String title, String subtitle, IconData icon, VoidCallback onTap) {
return InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(4),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 4),
padding: const EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: const Color(0xFF00B894).withOpacity(0.1),
borderRadius: BorderRadius.circular(8),
),
child: Icon(
icon,
color: const Color(0xFF00B894),
size: 20,
),
),
Icon(icon, color: AppColors.error, size: 16),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Color(0xFF1F2937),
),
),
Text(
subtitle,
style: TextStyle(
fontSize: 12,
color: Colors.grey[600],
),
),
Text(title, style: AppTypography.actionText.copyWith(fontSize: 12)),
Text(subtitle, style: AppTypography.subtitleSmall.copyWith(fontSize: 10)),
],
),
),
Icon(
Icons.arrow_forward_ios,
color: Colors.grey[400],
size: 16,
),
const Icon(Icons.chevron_right, color: AppColors.textSecondaryLight, size: 14),
],
),
),
@@ -846,8 +457,7 @@ class _AboutPageState extends State<AboutPage> {
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
// Ici on pourrait utiliser un package comme in_app_review
_showErrorSnackBar('Fonctionnalité bientôt disponible');
_launchStoreForRating();
},
style: ElevatedButton.styleFrom(
backgroundColor: ColorTokens.primary,
@@ -860,6 +470,45 @@ class _AboutPageState extends State<AboutPage> {
);
}
/// Partager les infos de l'app (titre, description, lien)
Future<void> _shareApp() async {
final version = _packageInfo != null
? '${_packageInfo!.version}+${_packageInfo!.buildNumber}'
: '';
await Share.share(
'Découvrez UnionFlow - Mouvement d\'entraide et de solidarité.\n'
'Version $version\n'
'https://unionflow.com',
subject: 'UnionFlow - Application mobile',
);
}
/// Ouvrir le store (Play Store / App Store) pour noter l'app
Future<void> _launchStoreForRating() async {
try {
final packageName = _packageInfo?.packageName ?? 'dev.lions.unionflow';
String storeUrl;
if (kIsWeb) {
storeUrl = 'https://unionflow.com';
} else if (defaultTargetPlatform == TargetPlatform.android) {
storeUrl = 'https://play.google.com/store/apps/details?id=$packageName';
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
// Remplacer par l'ID App Store réel une fois l'app publiée
storeUrl = 'https://apps.apple.com/app/id0000000000';
} else {
storeUrl = 'https://unionflow.com';
}
final uri = Uri.parse(storeUrl);
if (await canLaunchUrl(uri)) {
await launchUrl(uri, mode: LaunchMode.externalApplication);
} else {
_showErrorSnackBar('Impossible d\'ouvrir le store');
}
} catch (e) {
_showErrorSnackBar('Erreur lors de l\'ouverture du store');
}
}
/// Afficher un message d'erreur
void _showErrorSnackBar(String message) {
ScaffoldMessenger.of(context).showSnackBar(