feat(navigation): titre 'Mon/Mes Organisations' dynamique + fallback modules
Plus page (more_page.dart) : - Titre entrée Organisations dynamique selon rôle/nombre d'orgs : * SuperAdmin → 'Gestion des Organisations' * OrgAdmin 1 org → 'Mon Organisation' * OrgAdmin 2+ orgs → 'Mes Organisations' - Sous-titres adaptés - Helpers _orgTitle/_orgSubtitle utilisent OrgSwitcherBloc pour le count - 7 modules non encore implémentés (TONTINE, CREDIT, AGRICULTURE, COLLECTE_FONDS, PROJETS_ONG, CULTE_DONS, VOTES) : Navigator.pushNamed remplacé par _comingSoon() SnackBar 'Disponible prochainement' (les routes n'étaient enregistrées nulle part) - Entrée 'Comptes épargne' → 'Épargne & Crédit' (terme métier pour mutuelles) Organizations page : - AppBar title dynamique via _appBarTitle() (même logique que more_page) - SnackBars OrganizationCreated/Updated/Deleted : Color(0xFF16A34A) → AppColors.success
This commit is contained in:
@@ -8,10 +8,6 @@ import '../../shared/widgets/mini_avatar.dart';
|
|||||||
import '../di/injection_container.dart';
|
import '../di/injection_container.dart';
|
||||||
import '../network/org_context_service.dart';
|
import '../network/org_context_service.dart';
|
||||||
|
|
||||||
import '../../features/admin/presentation/pages/user_management_page.dart';
|
|
||||||
import '../../features/settings/presentation/pages/system_settings_page.dart';
|
|
||||||
import '../../features/backup/presentation/pages/backup_page.dart';
|
|
||||||
import '../../features/logs/presentation/pages/logs_page.dart';
|
|
||||||
import '../../features/reports/presentation/pages/reports_page_wrapper.dart';
|
import '../../features/reports/presentation/pages/reports_page_wrapper.dart';
|
||||||
import '../../features/epargne/presentation/pages/epargne_page.dart';
|
import '../../features/epargne/presentation/pages/epargne_page.dart';
|
||||||
import '../../features/contributions/presentation/pages/contributions_page_wrapper.dart' show CotisationsPageWrapper;
|
import '../../features/contributions/presentation/pages/contributions_page_wrapper.dart' show CotisationsPageWrapper;
|
||||||
@@ -20,6 +16,7 @@ import '../../features/solidarity/presentation/pages/demandes_aide_page_wrapper.
|
|||||||
import '../../features/organizations/presentation/pages/organizations_page_wrapper.dart';
|
import '../../features/organizations/presentation/pages/organizations_page_wrapper.dart';
|
||||||
import '../../features/organizations/presentation/pages/org_selector_page.dart';
|
import '../../features/organizations/presentation/pages/org_selector_page.dart';
|
||||||
import '../../features/organizations/bloc/org_switcher_bloc.dart';
|
import '../../features/organizations/bloc/org_switcher_bloc.dart';
|
||||||
|
import '../../shared/design_system/tokens/app_colors.dart';
|
||||||
import '../../features/profile/presentation/pages/profile_page_wrapper.dart';
|
import '../../features/profile/presentation/pages/profile_page_wrapper.dart';
|
||||||
|
|
||||||
/// Page "Plus" avec les fonctions avancées selon le rôle et les modules actifs.
|
/// Page "Plus" avec les fonctions avancées selon le rôle et les modules actifs.
|
||||||
@@ -39,10 +36,10 @@ class MorePage extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.lightBackground,
|
|
||||||
appBar: const UFAppBar(
|
appBar: const UFAppBar(
|
||||||
title: 'PLUS',
|
title: 'PLUS',
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
|
moduleGradient: ModuleColors.systemeGradient,
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
@@ -65,9 +62,7 @@ class MorePage extends StatelessWidget {
|
|||||||
|
|
||||||
Widget _buildUserProfile(
|
Widget _buildUserProfile(
|
||||||
BuildContext context, AuthAuthenticated state, OrgContextService orgCtx) {
|
BuildContext context, AuthAuthenticated state, OrgContextService orgCtx) {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
final textColor = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
|
||||||
final roleColor = isDark ? AppColors.brandGreenLight : AppColors.primaryGreen;
|
|
||||||
|
|
||||||
return CoreCard(
|
return CoreCard(
|
||||||
onTap: () => Navigator.of(context).push(
|
onTap: () => Navigator.of(context).push(
|
||||||
@@ -89,12 +84,12 @@ class MorePage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'${state.user.firstName} ${state.user.lastName}',
|
'${state.user.firstName} ${state.user.lastName}',
|
||||||
style: AppTypography.actionText.copyWith(color: textColor),
|
style: AppTypography.actionText.copyWith(color: scheme.onSurface),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
state.effectiveRole.displayName.toUpperCase(),
|
state.effectiveRole.displayName.toUpperCase(),
|
||||||
style: AppTypography.badgeText.copyWith(
|
style: AppTypography.badgeText.copyWith(
|
||||||
color: roleColor,
|
color: ModuleColors.profil,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -105,20 +100,16 @@ class MorePage extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Icon(Icons.chevron_right,
|
Icon(Icons.chevron_right, color: scheme.onSurfaceVariant, size: 16),
|
||||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight,
|
|
||||||
size: 16),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _openOrgSelector(BuildContext context) {
|
void _openOrgSelector(BuildContext context) {
|
||||||
// Vérifier que OrgSwitcherBloc est disponible (fourni par un ancêtre)
|
|
||||||
try {
|
try {
|
||||||
showOrgSelector(context);
|
showOrgSelector(context);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// OrgSwitcherBloc pas fourni dans ce contexte, navigation vers ProfilePage
|
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(builder: (_) => const ProfilePageWrapper()),
|
MaterialPageRoute(builder: (_) => const ProfilePageWrapper()),
|
||||||
);
|
);
|
||||||
@@ -129,48 +120,24 @@ class MorePage extends StatelessWidget {
|
|||||||
BuildContext context, AuthAuthenticated state, OrgContextService orgCtx) {
|
BuildContext context, AuthAuthenticated state, OrgContextService orgCtx) {
|
||||||
final options = <Widget>[];
|
final options = <Widget>[];
|
||||||
|
|
||||||
if (state.effectiveRole == UserRole.superAdmin) {
|
// Note: les items SYSTÈME (Gestion utilisateurs, Paramètres Système,
|
||||||
options.addAll([
|
// Sauvegarde & Restauration, Logs & Monitoring) ont été déplacés dans
|
||||||
_buildSectionTitle(context, 'Administration Système'),
|
// le burger drawer (section "Système" — super admin only) afin de
|
||||||
_buildOptionTile(context,
|
// respecter la démarcation Métier (Plus) / Système (Drawer).
|
||||||
icon: Icons.people,
|
|
||||||
title: 'Gestion des utilisateurs',
|
|
||||||
subtitle: 'Utilisateurs Keycloak et rôles',
|
|
||||||
onTap: () => Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(builder: (_) => const UserManagementPage())),
|
|
||||||
),
|
|
||||||
_buildOptionTile(context,
|
|
||||||
icon: Icons.settings,
|
|
||||||
title: 'Paramètres Système',
|
|
||||||
subtitle: 'Configuration globale',
|
|
||||||
onTap: () => Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(builder: (_) => const SystemSettingsPage())),
|
|
||||||
),
|
|
||||||
_buildOptionTile(context,
|
|
||||||
icon: Icons.backup,
|
|
||||||
title: 'Sauvegarde & Restauration',
|
|
||||||
subtitle: 'Gestion des sauvegardes',
|
|
||||||
onTap: () => Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(builder: (_) => const BackupPage())),
|
|
||||||
),
|
|
||||||
_buildOptionTile(context,
|
|
||||||
icon: Icons.article,
|
|
||||||
title: 'Logs & Monitoring',
|
|
||||||
subtitle: 'Surveillance et journaux',
|
|
||||||
onTap: () => Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(builder: (_) => const LogsPage())),
|
|
||||||
),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.effectiveRole == UserRole.orgAdmin ||
|
if (state.effectiveRole == UserRole.orgAdmin ||
|
||||||
state.effectiveRole == UserRole.superAdmin) {
|
state.effectiveRole == UserRole.superAdmin) {
|
||||||
|
final isSuperAdmin = state.effectiveRole == UserRole.superAdmin;
|
||||||
|
final orgTitle = _orgTitle(context, isSuperAdmin);
|
||||||
|
final orgSubtitle = _orgSubtitle(context, isSuperAdmin);
|
||||||
|
|
||||||
options.addAll([
|
options.addAll([
|
||||||
_buildSectionTitle(context, 'Administration'),
|
_buildSectionTitle(context, 'Administration'),
|
||||||
_buildOptionTile(context,
|
_buildOptionTile(context,
|
||||||
icon: Icons.business,
|
icon: Icons.business,
|
||||||
title: 'Gestion des Organisations',
|
title: orgTitle,
|
||||||
subtitle: 'Créer et gérer les organisations',
|
subtitle: orgSubtitle,
|
||||||
|
accentColor: ModuleColors.organisations,
|
||||||
onTap: () => Navigator.of(context).push(
|
onTap: () => Navigator.of(context).push(
|
||||||
MaterialPageRoute(builder: (_) => const OrganizationsPageWrapper())),
|
MaterialPageRoute(builder: (_) => const OrganizationsPageWrapper())),
|
||||||
),
|
),
|
||||||
@@ -179,12 +146,14 @@ class MorePage extends StatelessWidget {
|
|||||||
icon: Icons.pending_actions,
|
icon: Icons.pending_actions,
|
||||||
title: 'Approbations en attente',
|
title: 'Approbations en attente',
|
||||||
subtitle: 'Valider les transactions financières',
|
subtitle: 'Valider les transactions financières',
|
||||||
|
accentColor: ModuleColors.financeWorkflow,
|
||||||
onTap: () => Navigator.pushNamed(context, '/approvals'),
|
onTap: () => Navigator.pushNamed(context, '/approvals'),
|
||||||
),
|
),
|
||||||
_buildOptionTile(context,
|
_buildOptionTile(context,
|
||||||
icon: Icons.account_balance_wallet,
|
icon: Icons.account_balance_wallet,
|
||||||
title: 'Gestion des Budgets',
|
title: 'Gestion des Budgets',
|
||||||
subtitle: 'Créer et suivre les budgets',
|
subtitle: 'Créer et suivre les budgets',
|
||||||
|
accentColor: ModuleColors.financeWorkflow,
|
||||||
onTap: () => Navigator.pushNamed(context, '/budgets'),
|
onTap: () => Navigator.pushNamed(context, '/budgets'),
|
||||||
),
|
),
|
||||||
_buildSectionTitle(context, 'Communication'),
|
_buildSectionTitle(context, 'Communication'),
|
||||||
@@ -192,6 +161,7 @@ class MorePage extends StatelessWidget {
|
|||||||
icon: Icons.message,
|
icon: Icons.message,
|
||||||
title: 'Messages & Broadcast',
|
title: 'Messages & Broadcast',
|
||||||
subtitle: 'Communiquer avec les membres',
|
subtitle: 'Communiquer avec les membres',
|
||||||
|
accentColor: ModuleColors.communication,
|
||||||
onTap: () => Navigator.pushNamed(context, '/messages'),
|
onTap: () => Navigator.pushNamed(context, '/messages'),
|
||||||
),
|
),
|
||||||
_buildSectionTitle(context, 'Rapports & Analytics'),
|
_buildSectionTitle(context, 'Rapports & Analytics'),
|
||||||
@@ -199,6 +169,7 @@ class MorePage extends StatelessWidget {
|
|||||||
icon: Icons.assessment,
|
icon: Icons.assessment,
|
||||||
title: 'Rapports & Analytics',
|
title: 'Rapports & Analytics',
|
||||||
subtitle: 'Statistiques détaillées',
|
subtitle: 'Statistiques détaillées',
|
||||||
|
accentColor: ModuleColors.rapports,
|
||||||
onTap: () => Navigator.of(context).push(
|
onTap: () => Navigator.of(context).push(
|
||||||
MaterialPageRoute(builder: (_) => const ReportsPageWrapper())),
|
MaterialPageRoute(builder: (_) => const ReportsPageWrapper())),
|
||||||
),
|
),
|
||||||
@@ -212,6 +183,7 @@ class MorePage extends StatelessWidget {
|
|||||||
icon: Icons.message,
|
icon: Icons.message,
|
||||||
title: 'Messages aux membres',
|
title: 'Messages aux membres',
|
||||||
subtitle: 'Communiquer avec les membres',
|
subtitle: 'Communiquer avec les membres',
|
||||||
|
accentColor: ModuleColors.communication,
|
||||||
onTap: () => Navigator.pushNamed(context, '/messages'),
|
onTap: () => Navigator.pushNamed(context, '/messages'),
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
@@ -227,101 +199,92 @@ class MorePage extends StatelessWidget {
|
|||||||
final isAdmin = state.effectiveRole == UserRole.orgAdmin ||
|
final isAdmin = state.effectiveRole == UserRole.orgAdmin ||
|
||||||
state.effectiveRole == UserRole.superAdmin;
|
state.effectiveRole == UserRole.superAdmin;
|
||||||
|
|
||||||
// Module TONTINE
|
|
||||||
if (orgCtx.isModuleActif('TONTINE')) {
|
if (orgCtx.isModuleActif('TONTINE')) {
|
||||||
options.add(_buildSectionTitle(context, 'Tontine'));
|
options.add(_buildSectionTitle(context, 'Tontine'));
|
||||||
if (isAdmin) {
|
|
||||||
options.add(_buildOptionTile(context,
|
options.add(_buildOptionTile(context,
|
||||||
icon: Icons.autorenew,
|
icon: Icons.autorenew,
|
||||||
title: 'Gestion Tontine',
|
title: isAdmin ? 'Gestion Tontine' : 'Ma Tontine',
|
||||||
subtitle: 'Cycles, cotisations et remises',
|
subtitle: isAdmin ? 'Cycles, cotisations et remises' : 'Mes cycles et cotisations',
|
||||||
onTap: () => Navigator.pushNamed(context, '/tontine'),
|
accentColor: ModuleColors.cotisations,
|
||||||
|
onTap: () => _comingSoon(context, 'Tontine'),
|
||||||
));
|
));
|
||||||
} else {
|
|
||||||
options.add(_buildOptionTile(context,
|
|
||||||
icon: Icons.autorenew,
|
|
||||||
title: 'Ma Tontine',
|
|
||||||
subtitle: 'Mes cycles et cotisations',
|
|
||||||
onTap: () => Navigator.pushNamed(context, '/tontine'),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module EPARGNE
|
|
||||||
if (orgCtx.isModuleActif('EPARGNE')) {
|
if (orgCtx.isModuleActif('EPARGNE')) {
|
||||||
options.add(_buildSectionTitle(context, 'Épargne'));
|
options.add(_buildSectionTitle(context, 'Épargne'));
|
||||||
options.add(_buildOptionTile(context,
|
options.add(_buildOptionTile(context,
|
||||||
icon: Icons.savings,
|
icon: Icons.savings,
|
||||||
title: isAdmin ? 'Gestion Épargne' : 'Mon Épargne',
|
title: isAdmin ? 'Gestion Épargne' : 'Mon Épargne',
|
||||||
subtitle: isAdmin ? 'Comptes épargne et transactions' : 'Mon compte épargne',
|
subtitle: isAdmin ? 'Épargne, dépôts, crédits et transactions' : 'Mon épargne et mes crédits',
|
||||||
|
accentColor: ModuleColors.epargne,
|
||||||
onTap: () => Navigator.of(context).push(
|
onTap: () => Navigator.of(context).push(
|
||||||
MaterialPageRoute(builder: (_) => const EpargnePage())),
|
MaterialPageRoute(builder: (_) => const EpargnePage())),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module CREDIT
|
|
||||||
if (orgCtx.isModuleActif('CREDIT')) {
|
if (orgCtx.isModuleActif('CREDIT')) {
|
||||||
options.add(_buildSectionTitle(context, 'Crédit'));
|
options.add(_buildSectionTitle(context, 'Crédit'));
|
||||||
options.add(_buildOptionTile(context,
|
options.add(_buildOptionTile(context,
|
||||||
icon: Icons.account_balance,
|
icon: Icons.account_balance,
|
||||||
title: isAdmin ? 'Gestion Crédit' : 'Mon Crédit',
|
title: isAdmin ? 'Gestion Crédit' : 'Mon Crédit',
|
||||||
subtitle: isAdmin ? 'Demandes et suivi des crédits' : 'Mes demandes de crédit',
|
subtitle: isAdmin ? 'Demandes et suivi des crédits' : 'Mes demandes de crédit',
|
||||||
onTap: () => Navigator.pushNamed(context, '/credit'),
|
accentColor: ModuleColors.financeWorkflow,
|
||||||
|
onTap: () => _comingSoon(context, 'Crédit'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module AGRICULTURE
|
|
||||||
if (orgCtx.isModuleActif('AGRICULTURE')) {
|
if (orgCtx.isModuleActif('AGRICULTURE')) {
|
||||||
options.add(_buildSectionTitle(context, 'Agriculture'));
|
options.add(_buildSectionTitle(context, 'Agriculture'));
|
||||||
options.add(_buildOptionTile(context,
|
options.add(_buildOptionTile(context,
|
||||||
icon: Icons.eco,
|
icon: Icons.eco,
|
||||||
title: 'Campagnes Agricoles',
|
title: 'Campagnes Agricoles',
|
||||||
subtitle: 'Parcelles, récoltes et stocks',
|
subtitle: 'Parcelles, récoltes et stocks',
|
||||||
onTap: () => Navigator.pushNamed(context, '/agricole'),
|
accentColor: ModuleColors.epargne,
|
||||||
|
onTap: () => _comingSoon(context, 'Agriculture'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module COLLECTE_FONDS
|
|
||||||
if (orgCtx.isModuleActif('COLLECTE_FONDS')) {
|
if (orgCtx.isModuleActif('COLLECTE_FONDS')) {
|
||||||
options.add(_buildSectionTitle(context, 'Collecte de Fonds'));
|
options.add(_buildSectionTitle(context, 'Collecte de Fonds'));
|
||||||
options.add(_buildOptionTile(context,
|
options.add(_buildOptionTile(context,
|
||||||
icon: Icons.volunteer_activism,
|
icon: Icons.volunteer_activism,
|
||||||
title: 'Campagnes de Collecte',
|
title: 'Campagnes de Collecte',
|
||||||
subtitle: 'Dons et levées de fonds',
|
subtitle: 'Dons et levées de fonds',
|
||||||
onTap: () => Navigator.pushNamed(context, '/collecte'),
|
accentColor: ModuleColors.solidarite,
|
||||||
|
onTap: () => _comingSoon(context, 'Collecte de Fonds'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module PROJETS_ONG
|
|
||||||
if (orgCtx.isModuleActif('PROJETS_ONG')) {
|
if (orgCtx.isModuleActif('PROJETS_ONG')) {
|
||||||
options.add(_buildSectionTitle(context, 'Projets ONG'));
|
options.add(_buildSectionTitle(context, 'Projets ONG'));
|
||||||
options.add(_buildOptionTile(context,
|
options.add(_buildOptionTile(context,
|
||||||
icon: Icons.public,
|
icon: Icons.public,
|
||||||
title: 'Projets',
|
title: 'Projets',
|
||||||
subtitle: 'Gérer et suivre les projets',
|
subtitle: 'Gérer et suivre les projets',
|
||||||
onTap: () => Navigator.pushNamed(context, '/projets-ong'),
|
accentColor: ModuleColors.rapports,
|
||||||
|
onTap: () => _comingSoon(context, 'Projets ONG'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module CULTE_DONS
|
|
||||||
if (orgCtx.isModuleActif('CULTE_DONS')) {
|
if (orgCtx.isModuleActif('CULTE_DONS')) {
|
||||||
options.add(_buildSectionTitle(context, 'Culte & Dons'));
|
options.add(_buildSectionTitle(context, 'Culte & Dons'));
|
||||||
options.add(_buildOptionTile(context,
|
options.add(_buildOptionTile(context,
|
||||||
icon: Icons.church,
|
icon: Icons.church,
|
||||||
title: 'Dons et Offrandes',
|
title: 'Dons et Offrandes',
|
||||||
subtitle: 'Gestion des dons religieux',
|
subtitle: 'Gestion des dons religieux',
|
||||||
onTap: () => Navigator.pushNamed(context, '/culte'),
|
accentColor: ModuleColors.solidarite,
|
||||||
|
onTap: () => _comingSoon(context, 'Culte & Dons'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module VOTES
|
|
||||||
if (orgCtx.isModuleActif('VOTES')) {
|
if (orgCtx.isModuleActif('VOTES')) {
|
||||||
options.add(_buildSectionTitle(context, 'Votes'));
|
options.add(_buildSectionTitle(context, 'Votes'));
|
||||||
options.add(_buildOptionTile(context,
|
options.add(_buildOptionTile(context,
|
||||||
icon: Icons.how_to_vote,
|
icon: Icons.how_to_vote,
|
||||||
title: 'Votes & Élections',
|
title: 'Votes & Élections',
|
||||||
subtitle: 'Campagnes et résultats',
|
subtitle: 'Campagnes et résultats',
|
||||||
onTap: () => Navigator.pushNamed(context, '/votes'),
|
accentColor: ModuleColors.financeWorkflow,
|
||||||
|
onTap: () => _comingSoon(context, 'Votes & Élections'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,6 +298,7 @@ class MorePage extends StatelessWidget {
|
|||||||
icon: Icons.payment,
|
icon: Icons.payment,
|
||||||
title: 'Cotisations',
|
title: 'Cotisations',
|
||||||
subtitle: 'Gérer les cotisations',
|
subtitle: 'Gérer les cotisations',
|
||||||
|
accentColor: ModuleColors.cotisations,
|
||||||
onTap: () => Navigator.of(context).push(
|
onTap: () => Navigator.of(context).push(
|
||||||
MaterialPageRoute(builder: (_) => const CotisationsPageWrapper())),
|
MaterialPageRoute(builder: (_) => const CotisationsPageWrapper())),
|
||||||
),
|
),
|
||||||
@@ -342,6 +306,7 @@ class MorePage extends StatelessWidget {
|
|||||||
icon: Icons.how_to_reg,
|
icon: Icons.how_to_reg,
|
||||||
title: 'Demandes d\'adhésion',
|
title: 'Demandes d\'adhésion',
|
||||||
subtitle: 'Demandes d\'adhésion à une organisation',
|
subtitle: 'Demandes d\'adhésion à une organisation',
|
||||||
|
accentColor: ModuleColors.adhesions,
|
||||||
onTap: () => Navigator.of(context).push(
|
onTap: () => Navigator.of(context).push(
|
||||||
MaterialPageRoute(builder: (_) => const AdhesionsPageWrapper())),
|
MaterialPageRoute(builder: (_) => const AdhesionsPageWrapper())),
|
||||||
),
|
),
|
||||||
@@ -349,24 +314,64 @@ class MorePage extends StatelessWidget {
|
|||||||
icon: Icons.volunteer_activism,
|
icon: Icons.volunteer_activism,
|
||||||
title: 'Demandes d\'aide',
|
title: 'Demandes d\'aide',
|
||||||
subtitle: 'Solidarité – demandes d\'aide',
|
subtitle: 'Solidarité – demandes d\'aide',
|
||||||
|
accentColor: ModuleColors.solidarite,
|
||||||
onTap: () => Navigator.of(context).push(
|
onTap: () => Navigator.of(context).push(
|
||||||
MaterialPageRoute(builder: (_) => const DemandesAidePageWrapper())),
|
MaterialPageRoute(builder: (_) => const DemandesAidePageWrapper())),
|
||||||
),
|
),
|
||||||
// Épargne — affiché en commun uniquement si le module n'est PAS actif (évite doublon avec section module)
|
|
||||||
if (!orgCtx.isModuleActif('EPARGNE'))
|
if (!orgCtx.isModuleActif('EPARGNE'))
|
||||||
_buildOptionTile(context,
|
_buildOptionTile(context,
|
||||||
icon: Icons.savings_outlined,
|
icon: Icons.savings_outlined,
|
||||||
title: 'Comptes épargne',
|
title: 'Épargne & Crédit',
|
||||||
subtitle: 'Mutuelle épargne – dépôts (LCB-FT)',
|
subtitle: 'Comptes épargne, dépôts et crédits (LCB-FT)',
|
||||||
|
accentColor: ModuleColors.epargne,
|
||||||
onTap: () => Navigator.of(context).push(
|
onTap: () => Navigator.of(context).push(
|
||||||
MaterialPageRoute(builder: (_) => const EpargnePage())),
|
MaterialPageRoute(builder: (_) => const EpargnePage())),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSectionTitle(BuildContext context, String title) {
|
// ─── Helpers titre organisation ─────────────────────────────────────────
|
||||||
|
|
||||||
|
/// Titre de l'entrée "Organisation(s)" selon le rôle et le nombre d'orgs gérées.
|
||||||
|
String _orgTitle(BuildContext context, bool isSuperAdmin) {
|
||||||
|
if (isSuperAdmin) return 'Gestion des Organisations';
|
||||||
|
final switcherState = context.read<OrgSwitcherBloc>().state;
|
||||||
|
final count = switcherState is OrgSwitcherLoaded
|
||||||
|
? switcherState.organisations.length
|
||||||
|
: 1;
|
||||||
|
return count > 1 ? 'Mes Organisations' : 'Mon Organisation';
|
||||||
|
}
|
||||||
|
|
||||||
|
String _orgSubtitle(BuildContext context, bool isSuperAdmin) {
|
||||||
|
if (isSuperAdmin) return 'Créer et gérer les organisations';
|
||||||
|
final switcherState = context.read<OrgSwitcherBloc>().state;
|
||||||
|
final count = switcherState is OrgSwitcherLoaded
|
||||||
|
? switcherState.organisations.length
|
||||||
|
: 1;
|
||||||
|
return count > 1 ? 'Gérer mes organisations' : 'Gérer mon organisation';
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Modules non encore implémentés ─────────────────────────────────────
|
||||||
|
|
||||||
|
void _comingSoon(BuildContext context, String feature) {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Row(children: [
|
||||||
|
const Icon(Icons.construction_outlined, color: Colors.white, size: 16),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Expanded(child: Text('$feature — Disponible prochainement')),
|
||||||
|
]),
|
||||||
|
backgroundColor: isDark ? AppColors.surfaceVariantDark : AppColors.textSecondary,
|
||||||
|
behavior: SnackBarBehavior.floating,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildSectionTitle(BuildContext context, String title) {
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(top: 16, bottom: 6, left: 4),
|
padding: const EdgeInsets.only(top: 16, bottom: 6, left: 4),
|
||||||
child: Text(
|
child: Text(
|
||||||
@@ -374,7 +379,7 @@ class MorePage extends StatelessWidget {
|
|||||||
style: AppTypography.subtitleSmall.copyWith(
|
style: AppTypography.subtitleSmall.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
letterSpacing: 1.1,
|
letterSpacing: 1.1,
|
||||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight,
|
color: scheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -388,16 +393,8 @@ class MorePage extends StatelessWidget {
|
|||||||
required VoidCallback onTap,
|
required VoidCallback onTap,
|
||||||
Color? accentColor,
|
Color? accentColor,
|
||||||
}) {
|
}) {
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final accent = accentColor ?? scheme.primary;
|
||||||
final accent = accentColor ?? AppColors.primaryGreen;
|
|
||||||
final titleColor = accentColor != null
|
|
||||||
? accentColor
|
|
||||||
: (isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight);
|
|
||||||
final subtitleColor =
|
|
||||||
isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
|
||||||
final chevronColor =
|
|
||||||
isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
|
||||||
|
|
||||||
return CoreCard(
|
return CoreCard(
|
||||||
margin: const EdgeInsets.only(bottom: 8),
|
margin: const EdgeInsets.only(bottom: 8),
|
||||||
@@ -407,7 +404,7 @@ class MorePage extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(7),
|
padding: const EdgeInsets.all(7),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: accent.withOpacity(isDark ? 0.2 : 0.1),
|
color: accent.withOpacity(0.1),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Icon(icon, color: accent, size: 18),
|
child: Icon(icon, color: accent, size: 18),
|
||||||
@@ -419,16 +416,18 @@ class MorePage extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
style: AppTypography.actionText.copyWith(color: titleColor),
|
style: AppTypography.actionText.copyWith(
|
||||||
|
color: scheme.onSurface,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
subtitle,
|
subtitle,
|
||||||
style: AppTypography.subtitleSmall.copyWith(color: subtitleColor),
|
style: AppTypography.subtitleSmall.copyWith(color: scheme.onSurfaceVariant),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Icon(Icons.chevron_right, color: chevronColor, size: 16),
|
Icon(Icons.chevron_right, color: scheme.onSurfaceVariant, size: 16),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user