feat(features): refontes adhesions/admin/auth/backup/contributions/dashboard/epargne/events
- adhesions : bloc complet avec events/states/model, dialogs paiement/rejet - admin : users bloc, user management list/detail pages - authentication : bloc + keycloak auth service + webview - backup : bloc complet, repository, models - contributions : bloc + widgets + export - dashboard : widgets connectés (activities, events, notifications, search) + charts + monitoring + shortcuts - epargne : repository, transactions, dialogs - events : bloc complet, pages (detail, connected, wrapper), models
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
library create_event_dialog;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../shared/design_system/tokens/module_colors.dart';
|
||||
import '../../../../shared/design_system/tokens/color_tokens.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../../bloc/evenements_bloc.dart';
|
||||
@@ -55,7 +57,7 @@ class _CreateEventDialogState extends State<CreateEventDialog> {
|
||||
if (state is EvenementsError) {
|
||||
setState(() => _createSent = false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(state.message), backgroundColor: Colors.red),
|
||||
SnackBar(content: Text(state.message), backgroundColor: ColorTokens.error),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -65,7 +67,7 @@ class _CreateEventDialogState extends State<CreateEventDialog> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Événement créé avec succès'),
|
||||
backgroundColor: Colors.green,
|
||||
backgroundColor: ColorTokens.success,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -81,7 +83,7 @@ class _CreateEventDialogState extends State<CreateEventDialog> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF3B82F6),
|
||||
color: ModuleColors.evenements,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(4),
|
||||
topRight: Radius.circular(4),
|
||||
@@ -152,25 +154,32 @@ class _CreateEventDialogState extends State<CreateEventDialog> {
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Type d'événement
|
||||
DropdownButtonFormField<TypeEvenement>(
|
||||
value: _selectedType,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Type d\'événement *',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.category),
|
||||
),
|
||||
items: TypeEvenement.values.map((type) {
|
||||
return DropdownMenuItem(
|
||||
value: type,
|
||||
child: Text(_getTypeLabel(type)),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedType = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
Builder(builder: (context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return DropdownButtonFormField<TypeEvenement>(
|
||||
value: _selectedType,
|
||||
isExpanded: true,
|
||||
menuMaxHeight: 220,
|
||||
dropdownColor: scheme.surface,
|
||||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Type d\'événement *',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.category),
|
||||
),
|
||||
items: TypeEvenement.values.map((type) {
|
||||
return DropdownMenuItem(
|
||||
value: type,
|
||||
child: Text(_getTypeLabel(type), overflow: TextOverflow.ellipsis, style: TextStyle(color: scheme.onSurface)),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedType = value!;
|
||||
});
|
||||
},
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Dates
|
||||
@@ -296,8 +305,8 @@ class _CreateEventDialogState extends State<CreateEventDialog> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[100],
|
||||
border: Border(top: BorderSide(color: Colors.grey[300]!)),
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
border: Border(top: BorderSide(color: Theme.of(context).colorScheme.outline)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
@@ -310,7 +319,7 @@ class _CreateEventDialogState extends State<CreateEventDialog> {
|
||||
ElevatedButton(
|
||||
onPressed: _submitForm,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF3B82F6),
|
||||
backgroundColor: ModuleColors.evenements,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
child: const Text('Créer l\'événement'),
|
||||
@@ -331,7 +340,7 @@ class _CreateEventDialogState extends State<CreateEventDialog> {
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF3B82F6),
|
||||
color: ModuleColors.evenements,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
library edit_event_dialog;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../shared/design_system/tokens/module_colors.dart';
|
||||
import '../../../../shared/design_system/tokens/color_tokens.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../../bloc/evenements_bloc.dart';
|
||||
@@ -83,7 +85,7 @@ class _EditEventDialogState extends State<EditEventDialog> {
|
||||
if (state is EvenementsError) {
|
||||
setState(() => _updateSent = false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(state.message), backgroundColor: Colors.red),
|
||||
SnackBar(content: Text(state.message), backgroundColor: ColorTokens.error),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -93,7 +95,7 @@ class _EditEventDialogState extends State<EditEventDialog> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Événement modifié avec succès'),
|
||||
backgroundColor: Colors.green,
|
||||
backgroundColor: ColorTokens.success,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -109,7 +111,7 @@ class _EditEventDialogState extends State<EditEventDialog> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF3B82F6),
|
||||
color: ModuleColors.evenements,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(4),
|
||||
topRight: Radius.circular(4),
|
||||
@@ -180,53 +182,63 @@ class _EditEventDialogState extends State<EditEventDialog> {
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Type et statut
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: DropdownButtonFormField<TypeEvenement>(
|
||||
value: _selectedType,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Type *',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.category),
|
||||
Builder(builder: (context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: DropdownButtonFormField<TypeEvenement>(
|
||||
value: _selectedType,
|
||||
isExpanded: true,
|
||||
menuMaxHeight: 220,
|
||||
dropdownColor: scheme.surface,
|
||||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Type *',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.category),
|
||||
),
|
||||
items: TypeEvenement.values.map((type) {
|
||||
return DropdownMenuItem(
|
||||
value: type,
|
||||
child: Text(_getTypeLabel(type), overflow: TextOverflow.ellipsis, style: TextStyle(color: scheme.onSurface)),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedType = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
items: TypeEvenement.values.map((type) {
|
||||
return DropdownMenuItem(
|
||||
value: type,
|
||||
child: Text(_getTypeLabel(type)),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedType = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: DropdownButtonFormField<StatutEvenement>(
|
||||
value: _selectedStatut,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Statut *',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.flag),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: DropdownButtonFormField<StatutEvenement>(
|
||||
value: _selectedStatut,
|
||||
isExpanded: true,
|
||||
dropdownColor: scheme.surface,
|
||||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Statut *',
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.flag),
|
||||
),
|
||||
items: StatutEvenement.values.map((statut) {
|
||||
return DropdownMenuItem(
|
||||
value: statut,
|
||||
child: Text(_getStatutLabel(statut), overflow: TextOverflow.ellipsis, style: TextStyle(color: scheme.onSurface)),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedStatut = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
items: StatutEvenement.values.map((statut) {
|
||||
return DropdownMenuItem(
|
||||
value: statut,
|
||||
child: Text(_getStatutLabel(statut)),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedStatut = value!;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Dates
|
||||
@@ -355,8 +367,8 @@ class _EditEventDialogState extends State<EditEventDialog> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[100],
|
||||
border: Border(top: BorderSide(color: Colors.grey[300]!)),
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
border: Border(top: BorderSide(color: Theme.of(context).colorScheme.outline)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
@@ -369,7 +381,7 @@ class _EditEventDialogState extends State<EditEventDialog> {
|
||||
ElevatedButton(
|
||||
onPressed: _submitForm,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF3B82F6),
|
||||
backgroundColor: ModuleColors.evenements,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
child: const Text('Enregistrer'),
|
||||
@@ -390,7 +402,7 @@ class _EditEventDialogState extends State<EditEventDialog> {
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF3B82F6),
|
||||
color: ModuleColors.evenements,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
library inscription_event_dialog;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../shared/design_system/tokens/module_colors.dart';
|
||||
import '../../../../shared/design_system/tokens/color_tokens.dart';
|
||||
import '../../../../shared/design_system/tokens/app_colors.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import '../../bloc/evenements_bloc.dart';
|
||||
import '../../bloc/evenements_event.dart';
|
||||
@@ -46,7 +49,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
if (state is EvenementsError) {
|
||||
setState(() => _actionSent = false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(state.message), backgroundColor: Colors.red),
|
||||
SnackBar(content: Text(state.message), backgroundColor: ColorTokens.error),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -61,7 +64,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
: 'Désinscription réussie',
|
||||
),
|
||||
backgroundColor:
|
||||
state is EvenementInscrit ? Colors.green : Colors.orange,
|
||||
state is EvenementInscrit ? ColorTokens.success : ColorTokens.warning,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -108,7 +111,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: widget.isInscrit ? Colors.red : const Color(0xFF3B82F6),
|
||||
color: widget.isInscrit ? ColorTokens.error : ModuleColors.evenements,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(4),
|
||||
topRight: Radius.circular(4),
|
||||
@@ -144,8 +147,8 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue[50],
|
||||
border: Border.all(color: Colors.blue[200]!),
|
||||
color: ColorTokens.infoContainer,
|
||||
border: Border.all(color: ColorTokens.infoLight),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Column(
|
||||
@@ -153,7 +156,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.event, color: Color(0xFF3B82F6)),
|
||||
const Icon(Icons.event, color: ModuleColors.evenements),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
@@ -169,7 +172,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.calendar_today, size: 16, color: Colors.grey),
|
||||
const Icon(Icons.calendar_today, size: 16, color: AppColors.textTertiary),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
_formatDate(widget.evenement.dateDebut),
|
||||
@@ -181,7 +184,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.location_on, size: 16, color: Colors.grey),
|
||||
const Icon(Icons.location_on, size: 16, color: AppColors.textTertiary),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
@@ -205,9 +208,9 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: isComplet ? Colors.red[50] : Colors.green[50],
|
||||
color: isComplet ? ColorTokens.errorContainer : ColorTokens.successContainer,
|
||||
border: Border.all(
|
||||
color: isComplet ? Colors.red[200]! : Colors.green[200]!,
|
||||
color: isComplet ? ColorTokens.errorLight : ColorTokens.successLight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
@@ -215,7 +218,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
children: [
|
||||
Icon(
|
||||
isComplet ? Icons.warning : Icons.check_circle,
|
||||
color: isComplet ? Colors.red : Colors.green,
|
||||
color: isComplet ? ColorTokens.error : ColorTokens.success,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
@@ -226,7 +229,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
isComplet ? 'Événement complet' : 'Places disponibles',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: isComplet ? Colors.red[900] : Colors.green[900],
|
||||
color: isComplet ? ColorTokens.errorDark : ColorTokens.successDark,
|
||||
),
|
||||
),
|
||||
if (widget.evenement.maxParticipants != null)
|
||||
@@ -264,13 +267,13 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orange[50],
|
||||
border: Border.all(color: Colors.orange[200]!),
|
||||
color: ColorTokens.warningContainer,
|
||||
border: Border.all(color: ColorTokens.warningLight),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.warning, color: Colors.orange),
|
||||
Icon(Icons.warning, color: ColorTokens.warning),
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
@@ -291,8 +294,8 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[100],
|
||||
border: Border(top: BorderSide(color: Colors.grey[300]!)),
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||
border: Border(top: BorderSide(color: Theme.of(context).colorScheme.outline)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
@@ -305,7 +308,7 @@ class _InscriptionEventDialogState extends State<InscriptionEventDialog> {
|
||||
ElevatedButton(
|
||||
onPressed: (widget.isInscrit || !isComplet) ? _submitForm : null,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: widget.isInscrit ? Colors.red : const Color(0xFF3B82F6),
|
||||
backgroundColor: widget.isInscrit ? ColorTokens.error : ModuleColors.evenements,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
child: Text(widget.isInscrit ? 'Se désinscrire' : 'S\'inscrire'),
|
||||
|
||||
Reference in New Issue
Block a user