feat(features): refontes onboarding/organizations/profile/reports/settings/solidarity
- onboarding : datasource souscription, models formule/status, bloc complet - organizations : bloc orgs + switcher + types bloc, models, pages edit/create - profile : bloc complet avec change password, delete account, preferences - reports : bloc avec DashboardReports + ScheduleReports + GenerateReport - settings : language, privacy, feedback pages - solidarity : bloc complet demandes d'aide (CRUD, approuver, rejeter)
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import '../../data/models/souscription_status_model.dart';
|
import '../../data/models/souscription_status_model.dart';
|
||||||
import '../../../../features/authentication/presentation/bloc/auth_bloc.dart';
|
import '../../../../features/authentication/presentation/bloc/auth_bloc.dart';
|
||||||
import '../../../../shared/design_system/tokens/unionflow_colors.dart';
|
import '../../../../shared/design_system/tokens/unionflow_colors.dart';
|
||||||
|
import '../../../../shared/design_system/tokens/app_colors.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
|
||||||
/// Page de secours — affichée si l'auto-activation échoue après paiement.
|
/// Page de secours — affichée si l'auto-activation échoue après paiement.
|
||||||
@@ -55,7 +56,7 @@ class _AwaitingValidationPageState extends State<AwaitingValidationPage>
|
|||||||
final sosc = widget.souscription;
|
final sosc = widget.souscription;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: UnionFlowColors.background,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(28),
|
padding: const EdgeInsets.all(28),
|
||||||
@@ -199,7 +200,7 @@ class _AwaitingValidationPageState extends State<AwaitingValidationPage>
|
|||||||
),
|
),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: UnionFlowColors.unionGreen,
|
backgroundColor: UnionFlowColors.unionGreen,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: AppColors.onPrimary,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(14)),
|
borderRadius: BorderRadius.circular(14)),
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class _PeriodSelectionPageState extends State<PeriodSelectionPage> {
|
|||||||
final prixSelected = _estimerPrix(_selectedPeriode);
|
final prixSelected = _estimerPrix(_selectedPeriode);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: UnionFlowColors.background,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
OnboardingStepHeader(
|
OnboardingStepHeader(
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
/// Dialogue de création d'organisation (mutuelle)
|
/// Dialogue de création d'organisation
|
||||||
/// Formulaire complet pour créer une nouvelle mutuelle
|
/// Formulaire complet pour créer une nouvelle organisation
|
||||||
library create_organisation_dialog;
|
library create_organisation_dialog;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
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 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import '../../bloc/organizations_bloc.dart';
|
import '../../bloc/organizations_bloc.dart';
|
||||||
import '../../bloc/organizations_event.dart';
|
import '../../bloc/organizations_event.dart';
|
||||||
@@ -79,7 +82,7 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: Color(0xFF8B5CF6),
|
color: ModuleColors.organisations,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(4),
|
topLeft: Radius.circular(4),
|
||||||
topRight: Radius.circular(4),
|
topRight: Radius.circular(4),
|
||||||
@@ -90,7 +93,7 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
const Icon(Icons.business, color: Colors.white),
|
const Icon(Icons.business, color: Colors.white),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
const Text(
|
const Text(
|
||||||
'Créer une mutuelle',
|
'Nouvelle organisation',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
@@ -122,7 +125,7 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
TextFormField(
|
TextFormField(
|
||||||
controller: _nomController,
|
controller: _nomController,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Nom de la mutuelle *',
|
labelText: 'Nom de l\'organisation *',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
prefixIcon: Icon(Icons.business),
|
prefixIcon: Icon(Icons.business),
|
||||||
),
|
),
|
||||||
@@ -141,7 +144,7 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
labelText: 'Nom court / Sigle',
|
labelText: 'Nom court / Sigle',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
prefixIcon: Icon(Icons.short_text),
|
prefixIcon: Icon(Icons.short_text),
|
||||||
hintText: 'Ex: MUTEC, MUPROCI',
|
hintText: 'Ex: LIONS, CEADP',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
@@ -176,8 +179,13 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
child: LinearProgressIndicator(),
|
child: LinearProgressIndicator(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
return DropdownButtonFormField<String>(
|
return DropdownButtonFormField<String>(
|
||||||
value: types.any((t) => t.code == _selectedTypeCode) ? _selectedTypeCode : null,
|
value: types.any((t) => t.code == _selectedTypeCode) ? _selectedTypeCode : null,
|
||||||
|
isExpanded: true,
|
||||||
|
menuMaxHeight: 220,
|
||||||
|
dropdownColor: scheme.surface,
|
||||||
|
style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Type d\'organisation *',
|
labelText: 'Type d\'organisation *',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
@@ -185,7 +193,11 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
),
|
),
|
||||||
items: types.map((type) => DropdownMenuItem<String>(
|
items: types.map((type) => DropdownMenuItem<String>(
|
||||||
value: type.code,
|
value: type.code,
|
||||||
child: Text(type.libelle),
|
child: Text(
|
||||||
|
type.libelle,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(color: scheme.onSurface),
|
||||||
|
),
|
||||||
)).toList(),
|
)).toList(),
|
||||||
onChanged: (value) => setState(() => _selectedTypeCode = value),
|
onChanged: (value) => setState(() => _selectedTypeCode = value),
|
||||||
validator: (value) => value == null ? 'Le type est obligatoire' : null,
|
validator: (value) => value == null ? 'Le type est obligatoire' : null,
|
||||||
@@ -349,8 +361,8 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey[100],
|
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||||
border: Border(top: BorderSide(color: Colors.grey[300]!)),
|
border: Border(top: BorderSide(color: Theme.of(context).colorScheme.outline)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
@@ -363,10 +375,10 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _submitForm,
|
onPressed: _submitForm,
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: const Color(0xFF8B5CF6),
|
backgroundColor: ModuleColors.organisations,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: AppColors.onPrimary,
|
||||||
),
|
),
|
||||||
child: const Text('Créer la mutuelle'),
|
child: const Text('Créer l\'organisation'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -383,7 +395,7 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Color(0xFF8B5CF6),
|
color: ModuleColors.organisations,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -419,8 +431,8 @@ class _CreateOrganizationDialogState extends State<CreateOrganizationDialog> {
|
|||||||
// Afficher un message de succès
|
// Afficher un message de succès
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(
|
const SnackBar(
|
||||||
content: Text('Mutuelle créée avec succès'),
|
content: Text('Organisation créée avec succès'),
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: ColorTokens.success,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
/// Dialogue de modification d'organisation (mutuelle)
|
/// Dialogue de modification d'organisation
|
||||||
library edit_organisation_dialog;
|
library edit_organisation_dialog;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
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 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import '../../bloc/organizations_bloc.dart';
|
import '../../bloc/organizations_bloc.dart';
|
||||||
import '../../bloc/organizations_event.dart';
|
import '../../bloc/organizations_event.dart';
|
||||||
@@ -200,7 +203,7 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
color: Color(0xFF8B5CF6),
|
color: ModuleColors.organisations,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(4),
|
topLeft: Radius.circular(4),
|
||||||
topRight: Radius.circular(4),
|
topRight: Radius.circular(4),
|
||||||
@@ -211,7 +214,7 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
const Icon(Icons.edit, color: Colors.white),
|
const Icon(Icons.edit, color: Colors.white),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
const Text(
|
const Text(
|
||||||
'Modifier la mutuelle',
|
'Modifier l\'organisation',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
@@ -234,7 +237,7 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Color(0xFF8B5CF6),
|
color: ModuleColors.organisations,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -243,7 +246,7 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
return TextFormField(
|
return TextFormField(
|
||||||
controller: _nomController,
|
controller: _nomController,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Nom de la mutuelle *',
|
labelText: 'Nom de l\'organisation *',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
prefixIcon: Icon(Icons.business),
|
prefixIcon: Icon(Icons.business),
|
||||||
),
|
),
|
||||||
@@ -263,7 +266,7 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
labelText: 'Nom court / Sigle',
|
labelText: 'Nom court / Sigle',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
prefixIcon: Icon(Icons.short_text),
|
prefixIcon: Icon(Icons.short_text),
|
||||||
hintText: 'Ex: MUTEC, MUPROCI',
|
hintText: 'Ex: LIONS, CEADP',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -299,8 +302,13 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
child: LinearProgressIndicator(),
|
child: LinearProgressIndicator(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
return DropdownButtonFormField<String>(
|
return DropdownButtonFormField<String>(
|
||||||
value: types.any((t) => t.code == _selectedTypeCode) ? _selectedTypeCode : null,
|
value: types.any((t) => t.code == _selectedTypeCode) ? _selectedTypeCode : null,
|
||||||
|
isExpanded: true,
|
||||||
|
menuMaxHeight: 220,
|
||||||
|
dropdownColor: scheme.surface,
|
||||||
|
style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Type d\'organisation *',
|
labelText: 'Type d\'organisation *',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
@@ -308,7 +316,11 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
),
|
),
|
||||||
items: types.map((type) => DropdownMenuItem<String>(
|
items: types.map((type) => DropdownMenuItem<String>(
|
||||||
value: type.code,
|
value: type.code,
|
||||||
child: Text(type.libelle),
|
child: Text(
|
||||||
|
type.libelle,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(color: scheme.onSurface),
|
||||||
|
),
|
||||||
)).toList(),
|
)).toList(),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (value != null) setState(() => _selectedTypeCode = value);
|
if (value != null) setState(() => _selectedTypeCode = value);
|
||||||
@@ -320,8 +332,12 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildStatutDropdown() {
|
Widget _buildStatutDropdown() {
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
return DropdownButtonFormField<StatutOrganization>(
|
return DropdownButtonFormField<StatutOrganization>(
|
||||||
value: _selectedStatut,
|
value: _selectedStatut,
|
||||||
|
isExpanded: true,
|
||||||
|
dropdownColor: scheme.surface,
|
||||||
|
style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: scheme.onSurface),
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Statut *',
|
labelText: 'Statut *',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
@@ -330,7 +346,7 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
items: StatutOrganization.values.map((statut) {
|
items: StatutOrganization.values.map((statut) {
|
||||||
return DropdownMenuItem(
|
return DropdownMenuItem(
|
||||||
value: statut,
|
value: statut,
|
||||||
child: Text(statut.displayName),
|
child: Text(statut.displayName, style: TextStyle(color: scheme.onSurface)),
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
@@ -475,8 +491,8 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.grey[100],
|
color: Theme.of(context).colorScheme.surfaceContainerHighest,
|
||||||
border: Border(top: BorderSide(color: Colors.grey[300]!)),
|
border: Border(top: BorderSide(color: Theme.of(context).colorScheme.outline)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
@@ -489,8 +505,8 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: _submitForm,
|
onPressed: _submitForm,
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: const Color(0xFF8B5CF6),
|
backgroundColor: ModuleColors.organisations,
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: AppColors.onPrimary,
|
||||||
),
|
),
|
||||||
child: const Text('Enregistrer'),
|
child: const Text('Enregistrer'),
|
||||||
),
|
),
|
||||||
@@ -525,8 +541,8 @@ class _EditOrganizationDialogState extends State<EditOrganizationDialog> {
|
|||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(
|
const SnackBar(
|
||||||
content: Text('Mutuelle modifiée avec succès'),
|
content: Text('Organisation modifiée avec succès'),
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: ColorTokens.success,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ library organization_card;
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../data/models/organization_model.dart';
|
import '../../data/models/organization_model.dart';
|
||||||
|
import '../../../../shared/design_system/tokens/module_colors.dart';
|
||||||
|
import '../../../../shared/design_system/tokens/app_colors.dart';
|
||||||
|
|
||||||
/// Carte d'organisation avec design cohérent
|
/// Carte d'organisation avec design cohérent — theme-aware (mode jour/nuit)
|
||||||
class OrganizationCard extends StatelessWidget {
|
class OrganizationCard extends StatelessWidget {
|
||||||
final OrganizationModel organization;
|
final OrganizationModel organization;
|
||||||
final VoidCallback? onTap;
|
final VoidCallback? onTap;
|
||||||
@@ -24,14 +26,16 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.only(bottom: 8),
|
margin: const EdgeInsets.only(bottom: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: scheme.surface,
|
||||||
borderRadius: BorderRadius.circular(8), // RadiusTokens cohérent
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: scheme.outline.withOpacity(0.5)),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.05),
|
color: scheme.shadow.withOpacity(0.05),
|
||||||
blurRadius: 4,
|
blurRadius: 4,
|
||||||
offset: const Offset(0, 2),
|
offset: const Offset(0, 2),
|
||||||
),
|
),
|
||||||
@@ -41,15 +45,15 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(12), // SpacingTokens cohérent
|
padding: const EdgeInsets.all(12),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_buildHeader(),
|
_buildHeader(context),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
_buildContent(),
|
_buildContent(context),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
_buildFooter(),
|
_buildFooter(context),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -58,30 +62,29 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Header avec nom et statut
|
/// Header avec nom et statut
|
||||||
Widget _buildHeader() {
|
Widget _buildHeader(BuildContext context) {
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
// Icône du type d'organisation
|
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(6),
|
padding: const EdgeInsets.all(6),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0xFF6C5CE7).withOpacity(0.1), // ColorTokens cohérent
|
color: ModuleColors.organisations.withOpacity(0.1),
|
||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
),
|
),
|
||||||
child: const Icon(Icons.business_outlined, size: 18, color: Color(0xFF6C5CE7)),
|
child: const Icon(Icons.business_outlined, size: 18, color: Color(0xFF6C5CE7)),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
// Nom et nom court
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
organization.nom,
|
organization.nom,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Color(0xFF374151), // ColorTokens cohérent
|
color: scheme.onSurface,
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -90,16 +93,15 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
Text(
|
Text(
|
||||||
organization.nomCourt!,
|
organization.nomCourt!,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Color(0xFF6B7280),
|
color: scheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Badge de statut
|
|
||||||
_buildStatusBadge(),
|
_buildStatusBadge(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@@ -108,7 +110,6 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
/// Badge de statut
|
/// Badge de statut
|
||||||
Widget _buildStatusBadge() {
|
Widget _buildStatusBadge() {
|
||||||
final color = Color(int.parse(organization.statut.color.substring(1), radix: 16) + 0xFF000000);
|
final color = Color(int.parse(organization.statut.color.substring(1), radix: 16) + 0xFF000000);
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -127,46 +128,31 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Contenu principal
|
/// Contenu principal
|
||||||
Widget _buildContent() {
|
Widget _buildContent(BuildContext context) {
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Type d'organisation
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
Icon(Icons.category_outlined, size: 14, color: scheme.onSurfaceVariant),
|
||||||
Icons.category_outlined,
|
|
||||||
size: 14,
|
|
||||||
color: Color(0xFF6B7280),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
Text(
|
Text(
|
||||||
organization.typeOrganisation,
|
organization.typeOrganisation,
|
||||||
style: const TextStyle(
|
style: TextStyle(fontSize: 12, color: scheme.onSurfaceVariant),
|
||||||
fontSize: 12,
|
|
||||||
color: Color(0xFF6B7280),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
// Localisation
|
|
||||||
if (organization.ville?.isNotEmpty == true || organization.region?.isNotEmpty == true)
|
if (organization.ville?.isNotEmpty == true || organization.region?.isNotEmpty == true)
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const Icon(
|
Icon(Icons.location_on_outlined, size: 14, color: scheme.onSurfaceVariant),
|
||||||
Icons.location_on_outlined,
|
|
||||||
size: 14,
|
|
||||||
color: Color(0xFF6B7280),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 6),
|
const SizedBox(width: 6),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
_buildLocationText(),
|
_buildLocationText(),
|
||||||
style: const TextStyle(
|
style: TextStyle(fontSize: 12, color: scheme.onSurfaceVariant),
|
||||||
fontSize: 12,
|
|
||||||
color: Color(0xFF6B7280),
|
|
||||||
),
|
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
@@ -174,14 +160,10 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
// Description si disponible
|
|
||||||
if (organization.description?.isNotEmpty == true) ...[
|
if (organization.description?.isNotEmpty == true) ...[
|
||||||
Text(
|
Text(
|
||||||
organization.description!,
|
organization.description!,
|
||||||
style: const TextStyle(
|
style: TextStyle(fontSize: 12, color: scheme.onSurfaceVariant),
|
||||||
fontSize: 12,
|
|
||||||
color: Color(0xFF6B7280),
|
|
||||||
),
|
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
@@ -192,14 +174,14 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Footer avec statistiques et actions
|
/// Footer avec statistiques et actions
|
||||||
Widget _buildFooter() {
|
Widget _buildFooter(BuildContext context) {
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
// Statistiques
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
_buildStatItem(
|
_buildStatItem(
|
||||||
|
context: context,
|
||||||
icon: Icons.people_outline,
|
icon: Icons.people_outline,
|
||||||
value: organization.nombreMembres.toString(),
|
value: organization.nombreMembres.toString(),
|
||||||
label: 'membres',
|
label: 'membres',
|
||||||
@@ -207,6 +189,7 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
if (organization.ancienneteAnnees > 0)
|
if (organization.ancienneteAnnees > 0)
|
||||||
_buildStatItem(
|
_buildStatItem(
|
||||||
|
context: context,
|
||||||
icon: Icons.access_time,
|
icon: Icons.access_time,
|
||||||
value: organization.ancienneteAnnees.toString(),
|
value: organization.ancienneteAnnees.toString(),
|
||||||
label: 'ans',
|
label: 'ans',
|
||||||
@@ -214,7 +197,6 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Actions
|
|
||||||
if (showActions) _buildActions(),
|
if (showActions) _buildActions(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@@ -222,25 +204,23 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
|
|
||||||
/// Item de statistique
|
/// Item de statistique
|
||||||
Widget _buildStatItem({
|
Widget _buildStatItem({
|
||||||
|
required BuildContext context,
|
||||||
required IconData icon,
|
required IconData icon,
|
||||||
required String value,
|
required String value,
|
||||||
required String label,
|
required String label,
|
||||||
}) {
|
}) {
|
||||||
|
final scheme = Theme.of(context).colorScheme;
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(icon, size: 14, color: ModuleColors.organisations),
|
||||||
icon,
|
|
||||||
size: 14,
|
|
||||||
color: const Color(0xFF6C5CE7),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Text(
|
Text(
|
||||||
'$value $label',
|
'$value $label',
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Color(0xFF374151),
|
color: scheme.onSurface,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -255,31 +235,17 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
if (onEdit != null)
|
if (onEdit != null)
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: onEdit,
|
onPressed: onEdit,
|
||||||
icon: const Icon(
|
icon: const Icon(Icons.edit_outlined, size: 18, color: Color(0xFF6C5CE7)),
|
||||||
Icons.edit_outlined,
|
|
||||||
size: 18,
|
|
||||||
color: Color(0xFF6C5CE7),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(minWidth: 32, minHeight: 32),
|
||||||
minWidth: 32,
|
|
||||||
minHeight: 32,
|
|
||||||
),
|
|
||||||
tooltip: 'Modifier',
|
tooltip: 'Modifier',
|
||||||
),
|
),
|
||||||
if (onDelete != null)
|
if (onDelete != null)
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: onDelete,
|
onPressed: onDelete,
|
||||||
icon: Icon(
|
icon: const Icon(Icons.delete_outline, size: 18, color: AppColors.error),
|
||||||
Icons.delete_outline,
|
|
||||||
size: 18,
|
|
||||||
color: Colors.red.shade400,
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
constraints: const BoxConstraints(
|
constraints: const BoxConstraints(minWidth: 32, minHeight: 32),
|
||||||
minWidth: 32,
|
|
||||||
minHeight: 32,
|
|
||||||
),
|
|
||||||
tooltip: 'Supprimer',
|
tooltip: 'Supprimer',
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -289,15 +255,9 @@ class OrganizationCard extends StatelessWidget {
|
|||||||
/// Construit le texte de localisation
|
/// Construit le texte de localisation
|
||||||
String _buildLocationText() {
|
String _buildLocationText() {
|
||||||
final parts = <String>[];
|
final parts = <String>[];
|
||||||
if (organization.ville?.isNotEmpty == true) {
|
if (organization.ville?.isNotEmpty == true) parts.add(organization.ville!);
|
||||||
parts.add(organization.ville!);
|
if (organization.region?.isNotEmpty == true) parts.add(organization.region!);
|
||||||
}
|
if (organization.pays?.isNotEmpty == true) parts.add(organization.pays!);
|
||||||
if (organization.region?.isNotEmpty == true) {
|
|
||||||
parts.add(organization.region!);
|
|
||||||
}
|
|
||||||
if (organization.pays?.isNotEmpty == true) {
|
|
||||||
parts.add(organization.pays!);
|
|
||||||
}
|
|
||||||
return parts.join(', ');
|
return parts.join(', ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
library organization_filter_widget;
|
library organization_filter_widget;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import '../../../../../shared/design_system/tokens/app_colors.dart';
|
||||||
|
import '../../../../../shared/design_system/tokens/color_tokens.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import '../../bloc/organizations_bloc.dart';
|
import '../../bloc/organizations_bloc.dart';
|
||||||
import '../../bloc/organizations_event.dart';
|
import '../../bloc/organizations_event.dart';
|
||||||
@@ -24,11 +26,11 @@ class OrganizationFilterWidget extends StatelessWidget {
|
|||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
borderRadius: BorderRadius.circular(8), // RadiusTokens cohérent
|
borderRadius: BorderRadius.circular(8), // RadiusTokens cohérent
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.05),
|
color: AppColors.shadow,
|
||||||
blurRadius: 4,
|
blurRadius: 4,
|
||||||
offset: const Offset(0, 2),
|
offset: const Offset(0, 2),
|
||||||
),
|
),
|
||||||
@@ -50,7 +52,7 @@ class OrganizationFilterWidget extends StatelessWidget {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Color(0xFF374151),
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
@@ -119,9 +121,9 @@ class OrganizationFilterWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
isExpanded: true,
|
isExpanded: true,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Color(0xFF374151),
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
items: [
|
items: [
|
||||||
const DropdownMenuItem<StatutOrganization?>(
|
const DropdownMenuItem<StatutOrganization?>(
|
||||||
@@ -180,9 +182,9 @@ class OrganizationFilterWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
isExpanded: true,
|
isExpanded: true,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Color(0xFF374151),
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
items: [
|
items: [
|
||||||
const DropdownMenuItem<String?>(
|
const DropdownMenuItem<String?>(
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
library organisation_search_bar;
|
library organisation_search_bar;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import '../../../../../shared/design_system/tokens/app_colors.dart';
|
||||||
|
import '../../../../../shared/design_system/tokens/color_tokens.dart';
|
||||||
|
|
||||||
/// Barre de recherche avec design cohérent
|
/// Barre de recherche avec design cohérent
|
||||||
class OrganisationSearchBar extends StatefulWidget {
|
class OrganisationSearchBar extends StatefulWidget {
|
||||||
@@ -54,11 +56,11 @@ class _OrganisationSearchBarState extends State<OrganisationSearchBar> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
borderRadius: BorderRadius.circular(8), // RadiusTokens cohérent
|
borderRadius: BorderRadius.circular(8), // RadiusTokens cohérent
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.05),
|
color: AppColors.shadow,
|
||||||
blurRadius: 4,
|
blurRadius: 4,
|
||||||
offset: const Offset(0, 2),
|
offset: const Offset(0, 2),
|
||||||
),
|
),
|
||||||
@@ -102,9 +104,9 @@ class _OrganisationSearchBarState extends State<OrganisationSearchBar> {
|
|||||||
vertical: 12,
|
vertical: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Color(0xFF374151),
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
library organisation_stats_widget;
|
library organisation_stats_widget;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import '../../../../shared/design_system/tokens/app_colors.dart';
|
||||||
|
import '../../../../shared/design_system/tokens/color_tokens.dart';
|
||||||
|
|
||||||
/// Widget des statistiques avec design cohérent
|
/// Widget des statistiques avec design cohérent
|
||||||
class OrganisationStatsWidget extends StatelessWidget {
|
class OrganisationStatsWidget extends StatelessWidget {
|
||||||
@@ -20,11 +22,11 @@ class OrganisationStatsWidget extends StatelessWidget {
|
|||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Theme.of(context).colorScheme.surface,
|
||||||
borderRadius: BorderRadius.circular(8), // RadiusTokens cohérent
|
borderRadius: BorderRadius.circular(8), // RadiusTokens cohérent
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: Colors.black.withOpacity(0.05),
|
color: AppColors.shadow,
|
||||||
blurRadius: 4,
|
blurRadius: 4,
|
||||||
offset: const Offset(0, 2),
|
offset: const Offset(0, 2),
|
||||||
),
|
),
|
||||||
@@ -59,7 +61,7 @@ class OrganisationStatsWidget extends StatelessWidget {
|
|||||||
title: 'Actives',
|
title: 'Actives',
|
||||||
value: stats['actives']?.toString() ?? '0',
|
value: stats['actives']?.toString() ?? '0',
|
||||||
icon: Icons.check_circle,
|
icon: Icons.check_circle,
|
||||||
color: const Color(0xFF10B981),
|
color: ColorTokens.successLight,
|
||||||
onTap: () => onStatTap?.call('actives'),
|
onTap: () => onStatTap?.call('actives'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
import '../../../../shared/design_system/tokens/color_tokens.dart';
|
||||||
|
import '../../../../shared/design_system/tokens/module_colors.dart';
|
||||||
import '../../../members/data/models/membre_complete_model.dart';
|
import '../../../members/data/models/membre_complete_model.dart';
|
||||||
|
|
||||||
/// Widget d'affichage du statut KYC (Know Your Customer) d'un membre.
|
/// Widget d'affichage du statut KYC (Know Your Customer) d'un membre.
|
||||||
@@ -34,7 +36,7 @@ class KycStatusWidget extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.verified_user,
|
Icons.verified_user,
|
||||||
color: colorScheme.primary,
|
color: ModuleColors.profil,
|
||||||
size: 24,
|
size: 24,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
@@ -42,7 +44,7 @@ class KycStatusWidget extends StatelessWidget {
|
|||||||
'Vérification KYC (Anti-blanchiment)',
|
'Vérification KYC (Anti-blanchiment)',
|
||||||
style: theme.textTheme.titleMedium?.copyWith(
|
style: theme.textTheme.titleMedium?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: colorScheme.primary,
|
color: ModuleColors.profil,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -82,7 +84,7 @@ class KycStatusWidget extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: colorScheme.primaryContainer.withOpacity(0.3),
|
color: ModuleColors.profil.withOpacity(0.08),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -90,15 +92,13 @@ class KycStatusWidget extends StatelessWidget {
|
|||||||
Icon(
|
Icon(
|
||||||
Icons.info_outline,
|
Icons.info_outline,
|
||||||
size: 16,
|
size: 16,
|
||||||
color: colorScheme.primary,
|
color: ModuleColors.profil,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Ces informations sont gérées par l\'administrateur et permettent de garantir la conformité aux normes BCEAO/OHADA.',
|
'Ces informations sont gérées par l\'administrateur et permettent de garantir la conformité aux normes BCEAO/OHADA.',
|
||||||
style: theme.textTheme.bodySmall?.copyWith(
|
style: theme.textTheme.bodySmall,
|
||||||
color: colorScheme.onSurface,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -157,16 +157,16 @@ class KycStatusWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Color _getStatutKycColor(StatutKyc? statut) {
|
Color _getStatutKycColor(StatutKyc? statut) {
|
||||||
if (statut == null) return Colors.grey;
|
if (statut == null) return ColorTokens.textSecondary;
|
||||||
switch (statut) {
|
switch (statut) {
|
||||||
case StatutKyc.nonVerifie:
|
case StatutKyc.nonVerifie:
|
||||||
return Colors.orange;
|
return ColorTokens.warning;
|
||||||
case StatutKyc.enCours:
|
case StatutKyc.enCours:
|
||||||
return Colors.blue;
|
return ColorTokens.info;
|
||||||
case StatutKyc.verifie:
|
case StatutKyc.verifie:
|
||||||
return Colors.green;
|
return ColorTokens.success;
|
||||||
case StatutKyc.refuse:
|
case StatutKyc.refuse:
|
||||||
return Colors.red;
|
return ColorTokens.error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,12 +181,12 @@ class KycStatusWidget extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Color _getNiveauVigilanceColor(NiveauVigilanceKyc? niveau) {
|
Color _getNiveauVigilanceColor(NiveauVigilanceKyc? niveau) {
|
||||||
if (niveau == null) return Colors.grey;
|
if (niveau == null) return ColorTokens.textSecondary;
|
||||||
switch (niveau) {
|
switch (niveau) {
|
||||||
case NiveauVigilanceKyc.simplifie:
|
case NiveauVigilanceKyc.simplifie:
|
||||||
return Colors.blue;
|
return ColorTokens.info;
|
||||||
case NiveauVigilanceKyc.renforce:
|
case NiveauVigilanceKyc.renforce:
|
||||||
return Colors.deepOrange;
|
return ColorTokens.warning;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,110 @@ class SystemConfigRepositoryImpl implements ISystemConfigRepository {
|
|||||||
throw Exception('Erreur ${response.statusCode}');
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> optimizeDatabase() async {
|
||||||
|
final response = await _apiClient.post('$_base/database/optimize');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> forceGlobalLogout() async {
|
||||||
|
final response = await _apiClient.post('$_base/auth/logout-all');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> cleanupSessions() async {
|
||||||
|
final response = await _apiClient.post('$_base/sessions/cleanup');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> cleanOldLogs() async {
|
||||||
|
final response = await _apiClient.post('$_base/logs/cleanup');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> purgeExpiredData() async {
|
||||||
|
final response = await _apiClient.post('$_base/data/purge');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> analyzePerformance() async {
|
||||||
|
final response = await _apiClient.post('$_base/performance/analyze');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> createBackup() async {
|
||||||
|
final response = await _apiClient.post('$_base/backup/create');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> scheduleMaintenance({String? scheduledAt, String? reason}) async {
|
||||||
|
final queryParams = <String, String>{};
|
||||||
|
if (scheduledAt != null) queryParams['scheduledAt'] = scheduledAt;
|
||||||
|
if (reason != null) queryParams['reason'] = reason;
|
||||||
|
final response = await _apiClient.post(
|
||||||
|
'$_base/maintenance/schedule',
|
||||||
|
queryParameters: queryParams.isNotEmpty ? queryParams : null,
|
||||||
|
);
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> emergencyMaintenance() async {
|
||||||
|
final response = await _apiClient.post('$_base/maintenance/emergency');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> checkUpdates() async {
|
||||||
|
final response = await _apiClient.get('$_base/updates/check');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> exportLogs() async {
|
||||||
|
final response = await _apiClient.get('$_base/logs/export');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> generateUsageReport() async {
|
||||||
|
final response = await _apiClient.get('$_base/reports/usage');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> generateAuditReport() async {
|
||||||
|
final response = await _apiClient.get('$_base/audit/report');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Map<String, dynamic>> exportGDPRData() async {
|
||||||
|
final response = await _apiClient.post('$_base/gdpr/export');
|
||||||
|
if (response.statusCode == 200) return response.data as Map<String, dynamic>;
|
||||||
|
throw Exception('Erreur ${response.statusCode}');
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<SystemConfigModel> resetConfig() async {
|
Future<SystemConfigModel> resetConfig() async {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -30,4 +30,38 @@ abstract class ISystemConfigRepository {
|
|||||||
|
|
||||||
/// Réinitialise la configuration aux valeurs par défaut
|
/// Réinitialise la configuration aux valeurs par défaut
|
||||||
Future<SystemConfigModel> resetConfig();
|
Future<SystemConfigModel> resetConfig();
|
||||||
|
|
||||||
|
// ── Base de données ────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> optimizeDatabase();
|
||||||
|
|
||||||
|
// ── Sécurité / sessions ───────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> forceGlobalLogout();
|
||||||
|
Future<Map<String, dynamic>> cleanupSessions();
|
||||||
|
|
||||||
|
// ── Logs ──────────────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> cleanOldLogs();
|
||||||
|
Future<Map<String, dynamic>> exportLogs();
|
||||||
|
|
||||||
|
// ── Données ───────────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> purgeExpiredData();
|
||||||
|
|
||||||
|
// ── Performance ───────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> analyzePerformance();
|
||||||
|
|
||||||
|
// ── Sauvegarde ────────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> createBackup();
|
||||||
|
|
||||||
|
// ── Maintenance ───────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> scheduleMaintenance({String? scheduledAt, String? reason});
|
||||||
|
Future<Map<String, dynamic>> emergencyMaintenance();
|
||||||
|
|
||||||
|
// ── Mises à jour ──────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> checkUpdates();
|
||||||
|
|
||||||
|
// ── Rapports ──────────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> generateUsageReport();
|
||||||
|
Future<Map<String, dynamic>> generateAuditReport();
|
||||||
|
|
||||||
|
// ── RGPD ──────────────────────────────────────────────────────────────────
|
||||||
|
Future<Map<String, dynamic>> exportGDPRData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,20 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
|||||||
on<TestDatabaseConnection>(_onTestDatabaseConnection);
|
on<TestDatabaseConnection>(_onTestDatabaseConnection);
|
||||||
on<TestEmailConfiguration>(_onTestEmailConfiguration);
|
on<TestEmailConfiguration>(_onTestEmailConfiguration);
|
||||||
on<ResetSystemConfig>(_onResetSystemConfig);
|
on<ResetSystemConfig>(_onResetSystemConfig);
|
||||||
|
on<OptimizeDatabase>(_onOptimizeDatabase);
|
||||||
|
on<ForceGlobalLogout>(_onForceGlobalLogout);
|
||||||
|
on<CleanupSessions>(_onCleanupSessions);
|
||||||
|
on<CleanOldLogs>(_onCleanOldLogs);
|
||||||
|
on<PurgeExpiredData>(_onPurgeExpiredData);
|
||||||
|
on<AnalyzePerformance>(_onAnalyzePerformance);
|
||||||
|
on<CreateBackup>(_onCreateBackup);
|
||||||
|
on<ScheduleMaintenance>(_onScheduleMaintenance);
|
||||||
|
on<EmergencyMaintenance>(_onEmergencyMaintenance);
|
||||||
|
on<CheckUpdates>(_onCheckUpdates);
|
||||||
|
on<ExportLogs>(_onExportLogs);
|
||||||
|
on<GenerateUsageReport>(_onGenerateUsageReport);
|
||||||
|
on<GenerateAuditReport>(_onGenerateAuditReport);
|
||||||
|
on<ExportGDPRData>(_onExportGDPRData);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _onLoadSystemConfig(
|
Future<void> _onLoadSystemConfig(
|
||||||
@@ -165,4 +179,159 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
|||||||
emit(SystemSettingsError('Erreur de réinitialisation: ${e.toString()}'));
|
emit(SystemSettingsError('Erreur de réinitialisation: ${e.toString()}'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _onOptimizeDatabase(OptimizeDatabase event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.optimizeDatabase();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Base de données optimisée'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onForceGlobalLogout(ForceGlobalLogout event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.forceGlobalLogout();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Déconnexion globale déclenchée'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onCleanupSessions(CleanupSessions event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.cleanupSessions();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Sessions nettoyées'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onCleanOldLogs(CleanOldLogs event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.cleanOldLogs();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Logs nettoyés'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onPurgeExpiredData(PurgeExpiredData event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.purgeExpiredData();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Données purgées'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onAnalyzePerformance(AnalyzePerformance event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.analyzePerformance();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Analyse terminée'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onCreateBackup(CreateBackup event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.createBackup();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Sauvegarde créée'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onScheduleMaintenance(ScheduleMaintenance event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.scheduleMaintenance(scheduledAt: event.scheduledAt, reason: event.reason);
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Maintenance planifiée'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onEmergencyMaintenance(EmergencyMaintenance event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.emergencyMaintenance();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Maintenance d\'urgence activée'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onCheckUpdates(CheckUpdates event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.checkUpdates();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Vérification terminée'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onExportLogs(ExportLogs event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.exportLogs();
|
||||||
|
final count = result['count'] as int? ?? 0;
|
||||||
|
emit(SystemSettingsSuccess('$count log(s) exporté(s)'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onGenerateUsageReport(GenerateUsageReport event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.generateUsageReport();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Rapport généré'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onGenerateAuditReport(GenerateAuditReport event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.generateAuditReport();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Rapport d\'audit généré'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _onExportGDPRData(ExportGDPRData event, Emitter<SystemSettingsState> emit) async {
|
||||||
|
emit(SystemSettingsLoading());
|
||||||
|
try {
|
||||||
|
final result = await _repository.exportGDPRData();
|
||||||
|
emit(SystemSettingsSuccess(result['message'] as String? ?? 'Export RGPD initié'));
|
||||||
|
} catch (e) {
|
||||||
|
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||||
|
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,25 +10,63 @@ abstract class SystemSettingsEvent extends Equatable {
|
|||||||
List<Object?> get props => [];
|
List<Object?> get props => [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Chargement ─────────────────────────────────────────────────────────────
|
||||||
class LoadSystemConfig extends SystemSettingsEvent {}
|
class LoadSystemConfig extends SystemSettingsEvent {}
|
||||||
|
class LoadCacheStats extends SystemSettingsEvent {}
|
||||||
|
class LoadSystemMetrics extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Configuration ──────────────────────────────────────────────────────────
|
||||||
class UpdateSystemConfig extends SystemSettingsEvent {
|
class UpdateSystemConfig extends SystemSettingsEvent {
|
||||||
final Map<String, dynamic> config;
|
final Map<String, dynamic> config;
|
||||||
|
|
||||||
const UpdateSystemConfig(this.config);
|
const UpdateSystemConfig(this.config);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props => [config];
|
List<Object?> get props => [config];
|
||||||
}
|
}
|
||||||
|
|
||||||
class LoadCacheStats extends SystemSettingsEvent {}
|
class ResetSystemConfig extends SystemSettingsEvent {}
|
||||||
|
|
||||||
class LoadSystemMetrics extends SystemSettingsEvent {}
|
|
||||||
|
|
||||||
class ClearCache extends SystemSettingsEvent {}
|
|
||||||
|
|
||||||
|
// ── Tests ───────────────────────────────────────────────────────────────────
|
||||||
class TestDatabaseConnection extends SystemSettingsEvent {}
|
class TestDatabaseConnection extends SystemSettingsEvent {}
|
||||||
|
|
||||||
class TestEmailConfiguration extends SystemSettingsEvent {}
|
class TestEmailConfiguration extends SystemSettingsEvent {}
|
||||||
|
|
||||||
class ResetSystemConfig extends SystemSettingsEvent {}
|
// ── Cache ────────────────────────────────────────────────────────────────────
|
||||||
|
class ClearCache extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Base de données ──────────────────────────────────────────────────────────
|
||||||
|
class OptimizeDatabase extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Sécurité ─────────────────────────────────────────────────────────────────
|
||||||
|
class ForceGlobalLogout extends SystemSettingsEvent {}
|
||||||
|
class CleanupSessions extends SystemSettingsEvent {}
|
||||||
|
class ExportGDPRData extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Logs ─────────────────────────────────────────────────────────────────────
|
||||||
|
class CleanOldLogs extends SystemSettingsEvent {}
|
||||||
|
class ExportLogs extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Données ──────────────────────────────────────────────────────────────────
|
||||||
|
class PurgeExpiredData extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Performance ──────────────────────────────────────────────────────────────
|
||||||
|
class AnalyzePerformance extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Sauvegarde ────────────────────────────────────────────────────────────────
|
||||||
|
class CreateBackup extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Maintenance ───────────────────────────────────────────────────────────────
|
||||||
|
class ScheduleMaintenance extends SystemSettingsEvent {
|
||||||
|
final String? scheduledAt;
|
||||||
|
final String? reason;
|
||||||
|
const ScheduleMaintenance({this.scheduledAt, this.reason});
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [scheduledAt, reason];
|
||||||
|
}
|
||||||
|
|
||||||
|
class EmergencyMaintenance extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Mises à jour ──────────────────────────────────────────────────────────────
|
||||||
|
class CheckUpdates extends SystemSettingsEvent {}
|
||||||
|
|
||||||
|
// ── Rapports ──────────────────────────────────────────────────────────────────
|
||||||
|
class GenerateAuditReport extends SystemSettingsEvent {}
|
||||||
|
class GenerateUsageReport extends SystemSettingsEvent {}
|
||||||
|
|||||||
@@ -1,12 +1,30 @@
|
|||||||
/// Page dédiée à l'envoi de commentaires / feedback
|
/// Page dédiée à l'envoi de commentaires / feedback
|
||||||
/// Permet de soumettre des suggestions, signaler des bugs, ou proposer des idées
|
|
||||||
library feedback_page;
|
library feedback_page;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get_it/get_it.dart';
|
import '../../../../core/di/injection.dart';
|
||||||
import 'package:dio/dio.dart';
|
import '../../../../core/network/api_client.dart';
|
||||||
import '../../../../core/utils/logger.dart';
|
import '../../../../core/utils/logger.dart';
|
||||||
|
import '../../../../shared/design_system/components/uf_app_bar.dart';
|
||||||
import '../../../../shared/design_system/unionflow_design_system.dart';
|
import '../../../../shared/design_system/unionflow_design_system.dart';
|
||||||
|
import '../../../../shared/widgets/core_card.dart';
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
// Données statiques
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
const _kCategories = [
|
||||||
|
_FeedbackCategory('suggestion', 'Suggestion', Icons.lightbulb_outline, AppColors.primary),
|
||||||
|
_FeedbackCategory('bug', 'Bug / Problème', Icons.bug_report_outlined, AppColors.error),
|
||||||
|
_FeedbackCategory('amelioration', 'Amélioration', Icons.trending_up, AppColors.success),
|
||||||
|
_FeedbackCategory('autre', 'Autre', Icons.help_outline, AppColors.primaryDark),
|
||||||
|
];
|
||||||
|
|
||||||
|
const _kMaxLength = 1000;
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
// Page
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
class FeedbackPage extends StatefulWidget {
|
class FeedbackPage extends StatefulWidget {
|
||||||
const FeedbackPage({super.key});
|
const FeedbackPage({super.key});
|
||||||
@@ -19,13 +37,15 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
|||||||
final _messageController = TextEditingController();
|
final _messageController = TextEditingController();
|
||||||
String _selectedCategory = 'suggestion';
|
String _selectedCategory = 'suggestion';
|
||||||
bool _isSending = false;
|
bool _isSending = false;
|
||||||
|
int _charCount = 0;
|
||||||
|
|
||||||
static const _categories = [
|
@override
|
||||||
_FeedbackCategory('suggestion', 'Suggestion', Icons.lightbulb, AppColors.primaryGreen),
|
void initState() {
|
||||||
_FeedbackCategory('bug', 'Bug / Problème', Icons.bug_report, AppColors.error),
|
super.initState();
|
||||||
_FeedbackCategory('amelioration', 'Amélioration', Icons.trending_up, AppColors.success),
|
_messageController.addListener(
|
||||||
_FeedbackCategory('autre', 'Autre', Icons.help_outline, AppColors.brandGreen),
|
() => setState(() => _charCount = _messageController.text.length),
|
||||||
];
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
@@ -39,16 +59,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
|||||||
_showSnackBar('Veuillez saisir un message.', isError: true);
|
_showSnackBar('Veuillez saisir un message.', isError: true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(() => _isSending = true);
|
setState(() => _isSending = true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await GetIt.I<Dio>().post(
|
final cat = _kCategories.firstWhere((c) => c.id == _selectedCategory);
|
||||||
|
await getIt<ApiClient>().post(
|
||||||
'/api/feedback',
|
'/api/feedback',
|
||||||
data: {
|
data: {
|
||||||
'subject': 'Feedback mobile [$_selectedCategory]',
|
'subject': '[${cat.label}] Feedback mobile',
|
||||||
'message': message,
|
'message': message,
|
||||||
'categorie': _selectedCategory,
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
@@ -57,9 +75,7 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
|||||||
}
|
}
|
||||||
} catch (e, st) {
|
} catch (e, st) {
|
||||||
AppLogger.error('FeedbackPage: envoi feedback échoué', error: e, stackTrace: st);
|
AppLogger.error('FeedbackPage: envoi feedback échoué', error: e, stackTrace: st);
|
||||||
if (mounted) {
|
if (mounted) _showSnackBar('Envoi échoué. Réessayez plus tard.', isError: true);
|
||||||
_showSnackBar('Envoi échoué. Réessayez plus tard.', isError: true);
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
if (mounted) setState(() => _isSending = false);
|
if (mounted) setState(() => _isSending = false);
|
||||||
}
|
}
|
||||||
@@ -79,129 +95,56 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
body: Column(
|
appBar: UFAppBar(
|
||||||
|
title: 'Commentaires',
|
||||||
|
moduleGradient: ModuleColors.supportGradient,
|
||||||
|
),
|
||||||
|
body: SafeArea(
|
||||||
|
top: false,
|
||||||
|
child: ListView(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
children: [
|
children: [
|
||||||
_buildHeader(),
|
const SizedBox(height: 4),
|
||||||
Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
padding: const EdgeInsets.all(12),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
_buildCategorySection(),
|
_buildCategorySection(),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
_buildMessageSection(),
|
_buildMessageSection(),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 12),
|
||||||
_buildSubmitButton(),
|
_buildSubmitButton(),
|
||||||
const SizedBox(height: 80),
|
const SizedBox(height: 80),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildHeader() {
|
// ── Section catégories ────────────────────────────────────────────────────
|
||||||
return Container(
|
|
||||||
margin: const EdgeInsets.symmetric(horizontal: SpacingTokens.sm, vertical: SpacingTokens.xs),
|
|
||||||
padding: const EdgeInsets.all(SpacingTokens.md),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: const LinearGradient(
|
|
||||||
colors: [AppColors.brandGreen, AppColors.primaryGreen],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: AppColors.primaryGreen.withOpacity(0.3),
|
|
||||||
blurRadius: 20,
|
|
||||||
offset: const Offset(0, 8),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: SafeArea(
|
|
||||||
bottom: false,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
IconButton(
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
|
||||||
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.all(8),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white.withOpacity(0.2),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: const Icon(Icons.feedback, color: Colors.white, size: 20),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
const Expanded(
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'Commentaires',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'Aidez-nous à améliorer UnionFlow',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Colors.white70,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildCategorySection() {
|
Widget _buildCategorySection() {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
return CoreCard(
|
||||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
padding: const EdgeInsets.all(16),
|
||||||
return Container(
|
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withOpacity(0.05),
|
|
||||||
blurRadius: 10,
|
|
||||||
offset: const Offset(0, 2),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.category, color: textSecondary, size: 20),
|
Icon(Icons.category_outlined, color: scheme.onSurfaceVariant, size: 16),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
'Type de retour',
|
'TYPE DE RETOUR',
|
||||||
style: AppTypography.headerSmall.copyWith(fontWeight: FontWeight.w600, color: textPrimary),
|
style: AppTypography.subtitleSmall.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: 1.1,
|
||||||
|
color: scheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 12),
|
||||||
Wrap(
|
Wrap(
|
||||||
spacing: 10,
|
spacing: 8,
|
||||||
runSpacing: 10,
|
runSpacing: 8,
|
||||||
children: _categories.map((cat) => _buildCategoryChip(cat)).toList(),
|
children: _kCategories.map(_buildCategoryChip).toList(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -209,34 +152,37 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCategoryChip(_FeedbackCategory cat) {
|
Widget _buildCategoryChip(_FeedbackCategory cat) {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
final isSelected = _selectedCategory == cat.id;
|
final isSelected = _selectedCategory == cat.id;
|
||||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () => setState(() => _selectedCategory = cat.id),
|
onTap: () => setState(() => _selectedCategory = cat.id),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(8),
|
||||||
child: Container(
|
child: AnimatedContainer(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
duration: const Duration(milliseconds: 180),
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isSelected
|
color: isSelected ? cat.color.withOpacity(0.1) : scheme.surface,
|
||||||
? cat.color.withOpacity(0.12)
|
borderRadius: BorderRadius.circular(8),
|
||||||
: (isDark ? AppColors.darkBackground : Colors.grey[50]),
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isSelected ? cat.color.withOpacity(0.5) : (isDark ? AppColors.darkBorder : Colors.grey[200]!),
|
color: isSelected ? cat.color.withOpacity(0.5) : scheme.outlineVariant,
|
||||||
width: isSelected ? 1.5 : 1,
|
width: isSelected ? 1.5 : 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Icon(cat.icon, size: 18, color: isSelected ? cat.color : textSecondary),
|
Icon(
|
||||||
const SizedBox(width: 8),
|
cat.icon,
|
||||||
|
size: 15,
|
||||||
|
color: isSelected ? cat.color : scheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 6),
|
||||||
Text(
|
Text(
|
||||||
cat.label,
|
cat.label,
|
||||||
style: AppTypography.bodyTextSmall.copyWith(
|
style: AppTypography.actionText.copyWith(
|
||||||
|
fontSize: 12,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: isSelected ? cat.color : textSecondary,
|
color: isSelected ? cat.color : scheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -245,59 +191,70 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Section message ────────────────────────────────────────────────────────
|
||||||
|
|
||||||
Widget _buildMessageSection() {
|
Widget _buildMessageSection() {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final scheme = Theme.of(context).colorScheme;
|
||||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
final isNearLimit = _charCount > _kMaxLength * 0.85;
|
||||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
return CoreCard(
|
||||||
return Container(
|
padding: const EdgeInsets.all(16),
|
||||||
padding: const EdgeInsets.all(10),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(10),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withOpacity(0.05),
|
|
||||||
blurRadius: 10,
|
|
||||||
offset: const Offset(0, 2),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.edit_note, color: textSecondary, size: 20),
|
Icon(Icons.edit_note_outlined, color: scheme.onSurfaceVariant, size: 16),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Text(
|
Text(
|
||||||
'Votre message',
|
'VOTRE MESSAGE',
|
||||||
style: AppTypography.headerSmall.copyWith(fontWeight: FontWeight.w600, color: textPrimary),
|
style: AppTypography.subtitleSmall.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
letterSpacing: 1.1,
|
||||||
|
color: scheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
Text(
|
||||||
|
'$_charCount / $_kMaxLength',
|
||||||
|
style: AppTypography.subtitleSmall.copyWith(
|
||||||
|
fontSize: 10,
|
||||||
|
color: isNearLimit ? AppColors.error : scheme.onSurfaceVariant,
|
||||||
|
fontWeight: isNearLimit ? FontWeight.bold : FontWeight.normal,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 12),
|
||||||
TextField(
|
TextField(
|
||||||
controller: _messageController,
|
controller: _messageController,
|
||||||
maxLines: 6,
|
maxLines: 7,
|
||||||
style: AppTypography.bodyTextSmall.copyWith(color: textPrimary),
|
maxLength: _kMaxLength,
|
||||||
|
buildCounter: (_, {required currentLength, required isFocused, maxLength}) =>
|
||||||
|
const SizedBox.shrink(),
|
||||||
|
style: AppTypography.bodyTextSmall.copyWith(
|
||||||
|
color: scheme.onSurface,
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: 'Décrivez votre suggestion, problème ou idée...',
|
hintText: 'Décrivez votre suggestion, problème ou idée...',
|
||||||
hintStyle: AppTypography.subtitleSmall.copyWith(color: textSecondary),
|
hintStyle: AppTypography.subtitleSmall.copyWith(
|
||||||
border: OutlineInputBorder(
|
color: scheme.onSurfaceVariant,
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
borderSide: BorderSide(color: isDark ? AppColors.darkBorder : Colors.grey[300]!),
|
|
||||||
),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
borderSide: BorderSide(color: isDark ? AppColors.darkBorder : Colors.grey[300]!),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
borderSide: const BorderSide(color: AppColors.primaryGreen, width: 1.5),
|
|
||||||
),
|
),
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: isDark ? AppColors.darkBackground : Colors.grey[50],
|
fillColor: scheme.surfaceContainerHighest.withOpacity(0.4),
|
||||||
alignLabelWithHint: true,
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: BorderSide(color: scheme.outlineVariant),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: BorderSide(color: scheme.outlineVariant),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: BorderSide(color: ModuleColors.support, width: 1.5),
|
||||||
|
),
|
||||||
|
contentPadding: const EdgeInsets.all(12),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -305,6 +262,8 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Bouton envoi ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
Widget _buildSubmitButton() {
|
Widget _buildSubmitButton() {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@@ -312,32 +271,34 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
|||||||
onPressed: _isSending ? null : _submitFeedback,
|
onPressed: _isSending ? null : _submitFeedback,
|
||||||
icon: _isSending
|
icon: _isSending
|
||||||
? const SizedBox(
|
? const SizedBox(
|
||||||
width: 18,
|
width: 16,
|
||||||
height: 18,
|
height: 16,
|
||||||
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
|
child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white),
|
||||||
)
|
)
|
||||||
: const Icon(Icons.send, color: Colors.white),
|
: const Icon(Icons.send_rounded, color: Colors.white, size: 16),
|
||||||
label: Text(
|
label: Text(
|
||||||
_isSending ? 'Envoi en cours...' : 'Envoyer le commentaire',
|
_isSending ? 'Envoi en cours...' : 'Envoyer le commentaire',
|
||||||
style: const TextStyle(
|
style: AppTypography.actionText.copyWith(
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: AppColors.primaryGreen,
|
backgroundColor: ModuleColors.support,
|
||||||
|
disabledBackgroundColor: ModuleColors.support.withOpacity(0.5),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
borderRadius: BorderRadius.circular(8),
|
elevation: 0,
|
||||||
),
|
|
||||||
elevation: 2,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
// Modèle de catégorie
|
||||||
|
// ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
class _FeedbackCategory {
|
class _FeedbackCategory {
|
||||||
final String id;
|
final String id;
|
||||||
final String label;
|
final String label;
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
body: Column(
|
body: SafeArea(
|
||||||
|
top: false,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_buildHeader(),
|
_buildHeader(),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -73,6 +75,7 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,15 +84,15 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
margin: const EdgeInsets.all(SpacingTokens.lg),
|
margin: const EdgeInsets.all(SpacingTokens.lg),
|
||||||
padding: const EdgeInsets.all(SpacingTokens.xxl),
|
padding: const EdgeInsets.all(SpacingTokens.xxl),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: const LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [AppColors.brandGreen, AppColors.primaryGreen],
|
colors: ModuleColors.parametresGradient,
|
||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColors.primaryGreen.withOpacity(0.3),
|
color: ModuleColors.parametres.withOpacity(0.3),
|
||||||
blurRadius: 20,
|
blurRadius: 20,
|
||||||
offset: const Offset(0, 8),
|
offset: const Offset(0, 8),
|
||||||
),
|
),
|
||||||
@@ -142,12 +145,12 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
|
|
||||||
Widget _buildLanguageList() {
|
Widget _buildLanguageList() {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimary;
|
||||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
color: isDark ? AppColors.surfaceDark : Colors.white,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -173,8 +176,8 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
Widget _buildLanguageTile(_LanguageOption lang) {
|
Widget _buildLanguageTile(_LanguageOption lang) {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
final isSelected = _selectedLanguage == lang.name;
|
final isSelected = _selectedLanguage == lang.name;
|
||||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimary;
|
||||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 6),
|
padding: const EdgeInsets.only(bottom: 6),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
@@ -184,12 +187,12 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isSelected
|
color: isSelected
|
||||||
? AppColors.primaryGreen.withOpacity(0.08)
|
? AppColors.primary.withOpacity(0.08)
|
||||||
: (isDark ? AppColors.darkBackground : Colors.grey[50]),
|
: (isDark ? AppColors.backgroundSubtleDark : AppColors.backgroundSubtle),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: isSelected
|
border: isSelected
|
||||||
? Border.all(color: AppColors.primaryGreen.withOpacity(0.4), width: 1.5)
|
? Border.all(color: AppColors.primary.withOpacity(0.4), width: 1.5)
|
||||||
: Border.all(color: isDark ? AppColors.darkBorder : Colors.grey[200]!),
|
: Border.all(color: isDark ? AppColors.surfaceVariantDark : AppColors.surfaceVariant),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -203,7 +206,7 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
lang.name,
|
lang.name,
|
||||||
style: AppTypography.bodyTextSmall.copyWith(
|
style: AppTypography.bodyTextSmall.copyWith(
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: isSelected ? AppColors.primaryGreen : textPrimary,
|
color: isSelected ? AppColors.primary : textPrimary,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
@@ -214,7 +217,7 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (isSelected)
|
if (isSelected)
|
||||||
const Icon(Icons.check_circle, color: AppColors.primaryGreen, size: 22),
|
const Icon(Icons.check_circle, color: AppColors.primary, size: 22),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -224,12 +227,12 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
|||||||
|
|
||||||
Widget _buildInfoSection() {
|
Widget _buildInfoSection() {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimary;
|
||||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
color: isDark ? AppColors.surfaceDark : Colors.white,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||||
body: Column(
|
body: SafeArea(
|
||||||
|
top: false,
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
_buildHeader(),
|
_buildHeader(),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -83,6 +85,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,15 +94,15 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
margin: const EdgeInsets.all(SpacingTokens.lg),
|
margin: const EdgeInsets.all(SpacingTokens.lg),
|
||||||
padding: const EdgeInsets.all(SpacingTokens.xxl),
|
padding: const EdgeInsets.all(SpacingTokens.xxl),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: const LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [AppColors.brandGreen, AppColors.primaryGreen],
|
colors: ModuleColors.parametresGradient,
|
||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: AppColors.primaryGreen.withOpacity(0.3),
|
color: ModuleColors.parametres.withOpacity(0.3),
|
||||||
blurRadius: 20,
|
blurRadius: 20,
|
||||||
offset: const Offset(0, 8),
|
offset: const Offset(0, 8),
|
||||||
),
|
),
|
||||||
@@ -222,13 +225,13 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.red.withOpacity(0.05),
|
color: AppColors.error.withOpacity(0.05),
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(color: Colors.red.withOpacity(0.2)),
|
border: Border.all(color: AppColors.error.withOpacity(0.2)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.delete_forever, color: Colors.red, size: 20),
|
const Icon(Icons.delete_forever, color: AppColors.error, size: 20),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -239,7 +242,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Colors.red,
|
color: AppColors.error,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Builder(
|
Builder(
|
||||||
@@ -248,7 +251,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
return Text(
|
return Text(
|
||||||
'Supprimer définitivement toutes vos données',
|
'Supprimer définitivement toutes vos données',
|
||||||
style: AppTypography.subtitleSmall.copyWith(
|
style: AppTypography.subtitleSmall.copyWith(
|
||||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight,
|
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondary,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -256,7 +259,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Icon(Icons.arrow_forward_ios, color: Colors.red, size: 16),
|
const Icon(Icons.arrow_forward_ios, color: AppColors.error, size: 16),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -271,7 +274,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
title: const Row(
|
title: const Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.warning, color: Colors.red),
|
Icon(Icons.warning, color: AppColors.error),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
Text('Supprimer le compte'),
|
Text('Supprimer le compte'),
|
||||||
],
|
],
|
||||||
@@ -293,8 +296,8 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.red),
|
style: ElevatedButton.styleFrom(backgroundColor: AppColors.error),
|
||||||
child: const Text('Contacter l\'administrateur', style: TextStyle(color: Colors.white)),
|
child: const Text('Contacter l\'administrateur', style: TextStyle(color: AppColors.onPrimary)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -303,12 +306,12 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
|
|
||||||
Widget _buildSection(String title, String subtitle, IconData icon, List<Widget> children) {
|
Widget _buildSection(String title, String subtitle, IconData icon, List<Widget> children) {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimary;
|
||||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.all(10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
color: isDark ? AppColors.surfaceDark : AppColors.surface,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -352,17 +355,17 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
ValueChanged<bool> onChanged,
|
ValueChanged<bool> onChanged,
|
||||||
) {
|
) {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimary;
|
||||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isDark ? AppColors.darkBackground : Colors.grey[50],
|
color: isDark ? AppColors.backgroundSubtleDark : AppColors.backgroundSubtle,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.toggle_on, color: AppColors.primaryGreen, size: 20),
|
const Icon(Icons.toggle_on, color: AppColors.primary, size: 20),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -382,7 +385,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
|||||||
Switch(
|
Switch(
|
||||||
value: value,
|
value: value,
|
||||||
onChanged: onChanged,
|
onChanged: onChanged,
|
||||||
activeTrackColor: AppColors.primaryGreen,
|
activeTrackColor: AppColors.primary,
|
||||||
thumbColor: WidgetStateProperty.resolveWith((states) =>
|
thumbColor: WidgetStateProperty.resolveWith((states) =>
|
||||||
states.contains(WidgetState.selected) ? Colors.white : null),
|
states.contains(WidgetState.selected) ? Colors.white : null),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:get_it/get_it.dart';
|
import 'package:get_it/get_it.dart';
|
||||||
import '../../../../core/utils/logger.dart';
|
import '../../../../core/utils/logger.dart';
|
||||||
|
import '../../../../shared/design_system/unionflow_design_system.dart';
|
||||||
import '../../bloc/solidarity_bloc.dart';
|
import '../../bloc/solidarity_bloc.dart';
|
||||||
import '../../data/models/demande_aide_model.dart';
|
import '../../data/models/demande_aide_model.dart';
|
||||||
import '../../../organizations/domain/repositories/organization_repository.dart';
|
import '../../../organizations/domain/repositories/organization_repository.dart';
|
||||||
@@ -146,7 +147,7 @@ class _CreateDemandeAideDialogState extends State<CreateDemandeAideDialog> {
|
|||||||
enabled: false,
|
enabled: false,
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
const Text('Impossible de récupérer votre profil', style: TextStyle(color: Colors.red)),
|
const Text('Impossible de récupérer votre profil', style: TextStyle(color: AppColors.error)),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
controller: _titreController,
|
controller: _titreController,
|
||||||
|
|||||||
Reference in New Issue
Block a user