refactoring
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/// BLoC pour la gestion des paramètres système (Clean Architecture)
|
||||
library system_settings_bloc;
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
import '../../domain/usecases/get_settings.dart';
|
||||
@@ -48,6 +49,7 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
||||
final config = await _getSettings(); // ✅ Use case
|
||||
emit(SystemConfigLoaded(config));
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
emit(SystemSettingsError('Erreur de chargement: ${e.toString()}'));
|
||||
}
|
||||
}
|
||||
@@ -62,6 +64,7 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
||||
emit(SystemConfigLoaded(config));
|
||||
emit(const SystemSettingsSuccess('Configuration mise à jour'));
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
emit(SystemSettingsError('Erreur de mise à jour: ${e.toString()}'));
|
||||
}
|
||||
}
|
||||
@@ -75,6 +78,7 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
||||
final stats = await _getCacheStats(); // ✅ Use case
|
||||
emit(CacheStatsLoaded(stats));
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
emit(SystemSettingsError('Erreur de chargement: ${e.toString()}'));
|
||||
}
|
||||
}
|
||||
@@ -101,6 +105,7 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
||||
await _clearCache(); // ✅ Use case
|
||||
emit(const SystemSettingsSuccess('Cache vidé avec succès'));
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
emit(SystemSettingsError('Erreur: ${e.toString()}'));
|
||||
}
|
||||
}
|
||||
@@ -120,6 +125,7 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
||||
emit(SystemSettingsError(message));
|
||||
}
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
emit(SystemSettingsError('Erreur de test: ${e.toString()}'));
|
||||
}
|
||||
}
|
||||
@@ -139,6 +145,7 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
||||
emit(SystemSettingsError(message));
|
||||
}
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
emit(SystemSettingsError('Erreur de test: ${e.toString()}'));
|
||||
}
|
||||
}
|
||||
@@ -154,6 +161,7 @@ class SystemSettingsBloc extends Bloc<SystemSettingsEvent, SystemSettingsState>
|
||||
emit(SystemConfigLoaded(config));
|
||||
emit(const SystemSettingsSuccess('Configuration réinitialisée'));
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) return;
|
||||
emit(SystemSettingsError('Erreur de réinitialisation: ${e.toString()}'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
bool _isSending = false;
|
||||
|
||||
static const _categories = [
|
||||
_FeedbackCategory('suggestion', 'Suggestion', Icons.lightbulb, Color(0xFF6C5CE7)),
|
||||
_FeedbackCategory('bug', 'Bug / Problème', Icons.bug_report, Color(0xFFE17055)),
|
||||
_FeedbackCategory('amelioration', 'Amélioration', Icons.trending_up, Color(0xFF00B894)),
|
||||
_FeedbackCategory('autre', 'Autre', Icons.help_outline, Color(0xFF0984E3)),
|
||||
_FeedbackCategory('suggestion', 'Suggestion', Icons.lightbulb, AppColors.primaryGreen),
|
||||
_FeedbackCategory('bug', 'Bug / Problème', Icons.bug_report, AppColors.error),
|
||||
_FeedbackCategory('amelioration', 'Amélioration', Icons.trending_up, AppColors.success),
|
||||
_FeedbackCategory('autre', 'Autre', Icons.help_outline, AppColors.brandGreen),
|
||||
];
|
||||
|
||||
@override
|
||||
@@ -69,7 +69,7 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(message),
|
||||
backgroundColor: isError ? Colors.red : const Color(0xFF00B894),
|
||||
backgroundColor: isError ? AppColors.error : AppColors.success,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
);
|
||||
@@ -78,7 +78,7 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF8F9FA),
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
body: Column(
|
||||
children: [
|
||||
_buildHeader(),
|
||||
@@ -87,11 +87,11 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
_buildCategorySection(),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
_buildMessageSection(),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
_buildSubmitButton(),
|
||||
const SizedBox(height: 80),
|
||||
],
|
||||
@@ -105,18 +105,18 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
|
||||
Widget _buildHeader() {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(SpacingTokens.lg),
|
||||
padding: const EdgeInsets.all(SpacingTokens.xxl),
|
||||
margin: const EdgeInsets.symmetric(horizontal: SpacingTokens.sm, vertical: SpacingTokens.xs),
|
||||
padding: const EdgeInsets.all(SpacingTokens.md),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: ColorTokens.primaryGradient,
|
||||
colors: [AppColors.brandGreen, AppColors.primaryGreen],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: ColorTokens.primary.withOpacity(0.3),
|
||||
color: AppColors.primaryGreen.withOpacity(0.3),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
@@ -131,14 +131,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Icon(Icons.feedback, color: Colors.white, size: 24),
|
||||
child: const Icon(Icons.feedback, color: Colors.white, size: 20),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
const SizedBox(width: 12),
|
||||
const Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -168,11 +168,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
}
|
||||
|
||||
Widget _buildCategorySection() {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
@@ -186,19 +189,15 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.category, color: Colors.grey[600], size: 20),
|
||||
Icon(Icons.category, color: textSecondary, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Type de retour',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.grey[800],
|
||||
),
|
||||
style: AppTypography.headerSmall.copyWith(fontWeight: FontWeight.w600, color: textPrimary),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
Wrap(
|
||||
spacing: 10,
|
||||
runSpacing: 10,
|
||||
@@ -210,31 +209,34 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
}
|
||||
|
||||
Widget _buildCategoryChip(_FeedbackCategory cat) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final isSelected = _selectedCategory == cat.id;
|
||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
return InkWell(
|
||||
onTap: () => setState(() => _selectedCategory = cat.id),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? cat.color.withOpacity(0.12) : Colors.grey[50],
|
||||
color: isSelected
|
||||
? cat.color.withOpacity(0.12)
|
||||
: (isDark ? AppColors.darkBackground : Colors.grey[50]),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: isSelected ? cat.color.withOpacity(0.5) : Colors.grey[200]!,
|
||||
color: isSelected ? cat.color.withOpacity(0.5) : (isDark ? AppColors.darkBorder : Colors.grey[200]!),
|
||||
width: isSelected ? 1.5 : 1,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(cat.icon, size: 18, color: isSelected ? cat.color : Colors.grey[500]),
|
||||
Icon(cat.icon, size: 18, color: isSelected ? cat.color : textSecondary),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
cat.label,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
style: AppTypography.bodyTextSmall.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isSelected ? cat.color : Colors.grey[700],
|
||||
color: isSelected ? cat.color : textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -244,11 +246,14 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
}
|
||||
|
||||
Widget _buildMessageSection() {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
@@ -262,38 +267,36 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.edit_note, color: Colors.grey[600], size: 20),
|
||||
Icon(Icons.edit_note, color: textSecondary, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Votre message',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.grey[800],
|
||||
),
|
||||
style: AppTypography.headerSmall.copyWith(fontWeight: FontWeight.w600, color: textPrimary),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
TextField(
|
||||
controller: _messageController,
|
||||
maxLines: 6,
|
||||
style: AppTypography.bodyTextSmall.copyWith(color: textPrimary),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Décrivez votre suggestion, problème ou idée...',
|
||||
hintStyle: AppTypography.subtitleSmall.copyWith(color: textSecondary),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: Colors.grey[300]!),
|
||||
borderSide: BorderSide(color: isDark ? AppColors.darkBorder : Colors.grey[300]!),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: Colors.grey[300]!),
|
||||
borderSide: BorderSide(color: isDark ? AppColors.darkBorder : Colors.grey[300]!),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(color: ColorTokens.primary, width: 1.5),
|
||||
borderSide: const BorderSide(color: AppColors.primaryGreen, width: 1.5),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: Colors.grey[50],
|
||||
fillColor: isDark ? AppColors.darkBackground : Colors.grey[50],
|
||||
alignLabelWithHint: true,
|
||||
),
|
||||
),
|
||||
@@ -323,10 +326,10 @@ class _FeedbackPageState extends State<FeedbackPage> {
|
||||
),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: ColorTokens.primary,
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
backgroundColor: AppColors.primaryGreen,
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
elevation: 2,
|
||||
),
|
||||
|
||||
@@ -43,7 +43,7 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('Langue changée en $languageName'),
|
||||
backgroundColor: const Color(0xFF00B894),
|
||||
backgroundColor: AppColors.success,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
);
|
||||
@@ -53,7 +53,7 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF8F9FA),
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
body: Column(
|
||||
children: [
|
||||
_buildHeader(),
|
||||
@@ -62,9 +62,9 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
_buildLanguageList(),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
_buildInfoSection(),
|
||||
const SizedBox(height: 80),
|
||||
],
|
||||
@@ -82,14 +82,14 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
padding: const EdgeInsets.all(SpacingTokens.xxl),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: ColorTokens.primaryGradient,
|
||||
colors: [AppColors.brandGreen, AppColors.primaryGreen],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: ColorTokens.primary.withOpacity(0.3),
|
||||
color: AppColors.primaryGreen.withOpacity(0.3),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
@@ -104,12 +104,12 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Icon(Icons.language, color: Colors.white, size: 24),
|
||||
child: const Icon(Icons.language, color: Colors.white, size: 20),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
@@ -141,37 +141,29 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
}
|
||||
|
||||
Widget _buildLanguageList() {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.translate, color: Colors.grey[600], size: 20),
|
||||
Icon(Icons.translate, color: textSecondary, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Langues disponibles',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.grey[800],
|
||||
),
|
||||
style: AppTypography.headerSmall.copyWith(fontWeight: FontWeight.w600, color: textPrimary),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
..._supportedLanguages.map((lang) => _buildLanguageTile(lang)),
|
||||
],
|
||||
),
|
||||
@@ -179,22 +171,25 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
}
|
||||
|
||||
Widget _buildLanguageTile(_LanguageOption lang) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final isSelected = _selectedLanguage == lang.name;
|
||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
padding: const EdgeInsets.only(bottom: 6),
|
||||
child: InkWell(
|
||||
onTap: () => _changeLanguage(lang.name, lang.code),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(14),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? ColorTokens.primary.withOpacity(0.08)
|
||||
: Colors.grey[50],
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
? AppColors.primaryGreen.withOpacity(0.08)
|
||||
: (isDark ? AppColors.darkBackground : Colors.grey[50]),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: isSelected
|
||||
? Border.all(color: ColorTokens.primary.withOpacity(0.4), width: 1.5)
|
||||
: Border.all(color: Colors.grey[200]!),
|
||||
? Border.all(color: AppColors.primaryGreen.withOpacity(0.4), width: 1.5)
|
||||
: Border.all(color: isDark ? AppColors.darkBorder : Colors.grey[200]!),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -206,21 +201,20 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
children: [
|
||||
Text(
|
||||
lang.name,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
style: AppTypography.bodyTextSmall.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isSelected ? ColorTokens.primary : const Color(0xFF1F2937),
|
||||
color: isSelected ? AppColors.primaryGreen : textPrimary,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
lang.description,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
|
||||
style: AppTypography.subtitleSmall.copyWith(color: textSecondary),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (isSelected)
|
||||
const Icon(Icons.check_circle, color: ColorTokens.primary, size: 22),
|
||||
const Icon(Icons.check_circle, color: AppColors.primaryGreen, size: 22),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -229,41 +223,33 @@ class _LanguageSettingsPageState extends State<LanguageSettingsPage> {
|
||||
}
|
||||
|
||||
Widget _buildInfoSection() {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.info_outline, color: Colors.grey[600], size: 20),
|
||||
Icon(Icons.info_outline, color: textSecondary, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Information',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.grey[800],
|
||||
),
|
||||
style: AppTypography.headerSmall.copyWith(fontWeight: FontWeight.w600, color: textPrimary),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Le changement de langue s\'applique immédiatement à toute l\'interface. '
|
||||
'Les contenus générés par le serveur restent dans leur langue d\'origine.',
|
||||
style: TextStyle(fontSize: 13, color: Colors.grey[600], height: 1.5),
|
||||
style: AppTypography.subtitleSmall.copyWith(color: textSecondary, height: 1.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -52,7 +52,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(message),
|
||||
backgroundColor: const Color(0xFF00B894),
|
||||
backgroundColor: AppColors.success,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
);
|
||||
@@ -61,7 +61,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF8F9FA),
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
body: Column(
|
||||
children: [
|
||||
_buildHeader(),
|
||||
@@ -70,11 +70,11 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
_buildVisibilitySection(),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
_buildDataSection(),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
_buildDangerSection(),
|
||||
const SizedBox(height: 80),
|
||||
],
|
||||
@@ -92,14 +92,14 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
padding: const EdgeInsets.all(SpacingTokens.xxl),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: ColorTokens.primaryGradient,
|
||||
colors: [AppColors.brandGreen, AppColors.primaryGreen],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: ColorTokens.primary.withOpacity(0.3),
|
||||
color: AppColors.primaryGreen.withOpacity(0.3),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
@@ -114,12 +114,12 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.white),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Icon(Icons.privacy_tip, color: Colors.white, size: 24),
|
||||
child: const Icon(Icons.privacy_tip, color: Colors.white, size: 20),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
const Expanded(
|
||||
@@ -218,12 +218,12 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
[
|
||||
InkWell(
|
||||
onTap: _showDeleteAccountDialog,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.withOpacity(0.05),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: Colors.red.withOpacity(0.2)),
|
||||
),
|
||||
child: Row(
|
||||
@@ -242,14 +242,21 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
color: Colors.red,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Supprimer définitivement toutes vos données',
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
|
||||
Builder(
|
||||
builder: (ctx) {
|
||||
final isDark = Theme.of(ctx).brightness == Brightness.dark;
|
||||
return Text(
|
||||
'Supprimer définitivement toutes vos données',
|
||||
style: AppTypography.subtitleSmall.copyWith(
|
||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Icon(Icons.arrow_forward_ios, color: Colors.grey[400], size: 16),
|
||||
const Icon(Icons.arrow_forward_ios, color: Colors.red, size: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -295,25 +302,21 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
}
|
||||
|
||||
Widget _buildSection(String title, String subtitle, IconData icon, List<Widget> children) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
color: isDark ? AppColors.darkSurface : Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(icon, color: Colors.grey[600], size: 20),
|
||||
Icon(icon, color: textSecondary, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -321,24 +324,20 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.grey[800],
|
||||
),
|
||||
style: AppTypography.headerSmall.copyWith(fontWeight: FontWeight.w600, color: textPrimary),
|
||||
),
|
||||
Text(
|
||||
subtitle,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
|
||||
style: AppTypography.subtitleSmall.copyWith(color: textSecondary),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
...children.map((child) => Padding(
|
||||
padding: const EdgeInsets.only(bottom: 12),
|
||||
padding: const EdgeInsets.only(bottom: 6),
|
||||
child: child,
|
||||
)),
|
||||
],
|
||||
@@ -352,15 +351,18 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
bool value,
|
||||
ValueChanged<bool> onChanged,
|
||||
) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
||||
final textSecondary = isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey[50],
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
color: isDark ? AppColors.darkBackground : Colors.grey[50],
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.toggle_on, color: ColorTokens.primary, size: 20),
|
||||
const Icon(Icons.toggle_on, color: AppColors.primaryGreen, size: 20),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -368,15 +370,11 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1F2937),
|
||||
),
|
||||
style: AppTypography.bodyTextSmall.copyWith(fontWeight: FontWeight.w600, color: textPrimary),
|
||||
),
|
||||
Text(
|
||||
subtitle,
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey[600]),
|
||||
style: AppTypography.subtitleSmall.copyWith(color: textSecondary),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -384,7 +382,7 @@ class _PrivacySettingsPageState extends State<PrivacySettingsPage> {
|
||||
Switch(
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
activeTrackColor: ColorTokens.primary,
|
||||
activeTrackColor: AppColors.primaryGreen,
|
||||
thumbColor: WidgetStateProperty.resolveWith((states) =>
|
||||
states.contains(WidgetState.selected) ? Colors.white : null),
|
||||
),
|
||||
|
||||
@@ -65,7 +65,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
// Accès réservé aux super administrateurs (configuration système globale)
|
||||
if (authState is! AuthAuthenticated || authState.effectiveRole != UserRole.superAdmin) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF8F9FA),
|
||||
backgroundColor: AppColors.lightBackground,
|
||||
appBar: AppBar(
|
||||
title: const Text('Paramètres Système'),
|
||||
leading: IconButton(
|
||||
@@ -80,14 +80,14 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.lock_outline, size: 64, color: ColorTokens.onSurfaceVariant.withOpacity(0.5)),
|
||||
Icon(Icons.lock_outline, size: 64, color: AppColors.textSecondaryLight.withOpacity(0.5)),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Accès réservé',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: ColorTokens.onSurface,
|
||||
color: AppColors.textPrimaryLight,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
@@ -96,7 +96,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Les paramètres système sont réservés aux administrateurs plateforme.',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: ColorTokens.onSurfaceVariant,
|
||||
color: AppColors.textSecondaryLight,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
@@ -121,7 +121,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(state.message),
|
||||
backgroundColor: ColorTokens.success,
|
||||
backgroundColor: AppColors.success,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
);
|
||||
@@ -129,7 +129,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(state.error),
|
||||
backgroundColor: ColorTokens.error,
|
||||
backgroundColor: AppColors.error,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
);
|
||||
@@ -137,7 +137,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
},
|
||||
builder: (context, state) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF8F9FA),
|
||||
backgroundColor: AppColors.lightBackground,
|
||||
body: Column(
|
||||
children: [
|
||||
// Header harmonisé
|
||||
@@ -172,18 +172,18 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
/// Header harmonisé avec indicateurs système
|
||||
Widget _buildHeader() {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(SpacingTokens.lg),
|
||||
padding: const EdgeInsets.all(SpacingTokens.xxl),
|
||||
margin: const EdgeInsets.symmetric(horizontal: SpacingTokens.sm, vertical: SpacingTokens.xs),
|
||||
padding: const EdgeInsets.all(SpacingTokens.md),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: ColorTokens.primaryGradient,
|
||||
colors: [AppColors.brandGreen, AppColors.primaryGreen],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(SpacingTokens.xl),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: ColorTokens.primary.withOpacity(0.3),
|
||||
color: AppColors.primaryGreen.withOpacity(0.3),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
@@ -194,18 +194,18 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.settings,
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -263,8 +263,8 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// Indicateurs système
|
||||
Row(
|
||||
children: [
|
||||
@@ -354,9 +354,9 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
),
|
||||
child: TabBar(
|
||||
controller: _tabController,
|
||||
labelColor: ColorTokens.primary,
|
||||
unselectedLabelColor: ColorTokens.onSurfaceVariant,
|
||||
indicatorColor: ColorTokens.primary,
|
||||
labelColor: AppColors.primaryGreen,
|
||||
unselectedLabelColor: AppColors.textSecondaryLight,
|
||||
indicatorColor: AppColors.primaryGreen,
|
||||
indicatorWeight: 3,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
labelStyle: const TextStyle(
|
||||
@@ -399,7 +399,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// Configuration de base
|
||||
_buildSettingsSection(
|
||||
@@ -457,14 +457,14 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
? 'Supprimer tous les fichiers temporaires (${_metrics!.totalCacheSizeFormatted ?? "0 B"})'
|
||||
: 'Supprimer tous les fichiers temporaires',
|
||||
Icons.delete_sweep,
|
||||
const Color(0xFFE17055),
|
||||
AppColors.warning,
|
||||
() => _clearSystemCache(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
'Optimiser la base de données',
|
||||
'Réorganiser et compacter la base de données',
|
||||
Icons.tune,
|
||||
const Color(0xFF0984E3),
|
||||
AppColors.primaryGreen,
|
||||
() => _optimizeDatabase(),
|
||||
),
|
||||
],
|
||||
@@ -485,7 +485,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Tester la connectivité',
|
||||
'Vérifier la connexion aux services',
|
||||
Icons.network_ping,
|
||||
const Color(0xFF00B894),
|
||||
AppColors.success,
|
||||
() => _testConnectivity(),
|
||||
),
|
||||
],
|
||||
@@ -533,7 +533,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Régénérer les clés API',
|
||||
'Créer de nouvelles clés d\'authentification',
|
||||
Icons.vpn_key,
|
||||
const Color(0xFFE17055),
|
||||
AppColors.warning,
|
||||
() => _regenerateApiKeys(),
|
||||
),
|
||||
],
|
||||
@@ -566,7 +566,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Réinitialiser les sessions',
|
||||
'Nettoyer les sessions expirées',
|
||||
Icons.refresh,
|
||||
const Color(0xFF0984E3),
|
||||
AppColors.primaryGreen,
|
||||
() => _resetSessions(),
|
||||
),
|
||||
],
|
||||
@@ -584,21 +584,21 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Générer rapport d\'audit',
|
||||
'Créer un rapport complet des activités',
|
||||
Icons.assessment,
|
||||
ColorTokens.primary,
|
||||
AppColors.primaryGreen,
|
||||
() => _generateAuditReport(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
'Export RGPD',
|
||||
'Exporter toutes les données utilisateurs',
|
||||
Icons.download,
|
||||
const Color(0xFF00B894),
|
||||
AppColors.success,
|
||||
() => _exportGDPRData(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
'Purge des données',
|
||||
'Supprimer les données expirées (RGPD)',
|
||||
Icons.auto_delete,
|
||||
const Color(0xFFE17055),
|
||||
AppColors.warning,
|
||||
() => _purgeExpiredData(),
|
||||
),
|
||||
],
|
||||
@@ -701,14 +701,14 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Analyser les performances',
|
||||
'Scanner les goulots d\'étranglement',
|
||||
Icons.analytics,
|
||||
const Color(0xFF0984E3),
|
||||
AppColors.primaryGreen,
|
||||
() => _analyzePerformance(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
'Nettoyer les logs anciens',
|
||||
'Supprimer les logs de plus de 30 jours',
|
||||
Icons.cleaning_services,
|
||||
const Color(0xFFE17055),
|
||||
AppColors.warning,
|
||||
() => _cleanOldLogs(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
@@ -761,14 +761,14 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Créer une sauvegarde maintenant',
|
||||
'Sauvegarder immédiatement toutes les données',
|
||||
Icons.save,
|
||||
const Color(0xFF00B894),
|
||||
AppColors.success,
|
||||
() => _createBackup(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
'Restaurer depuis une sauvegarde',
|
||||
'Récupérer des données depuis un fichier',
|
||||
Icons.restore,
|
||||
const Color(0xFF0984E3),
|
||||
AppColors.primaryGreen,
|
||||
() => _restoreFromBackup(),
|
||||
),
|
||||
],
|
||||
@@ -794,7 +794,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Planifier une maintenance',
|
||||
'Programmer une fenêtre de maintenance',
|
||||
Icons.schedule,
|
||||
ColorTokens.primary,
|
||||
AppColors.primaryGreen,
|
||||
() => _scheduleMaintenance(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
@@ -827,14 +827,14 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Vérifier les mises à jour',
|
||||
'Rechercher les nouvelles versions',
|
||||
Icons.refresh,
|
||||
const Color(0xFF0984E3),
|
||||
AppColors.primaryGreen,
|
||||
() => _checkUpdates(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
'Historique des mises à jour',
|
||||
'Voir les versions précédentes',
|
||||
Icons.history,
|
||||
ColorTokens.primary,
|
||||
AppColors.primaryGreen,
|
||||
() => _showUpdateHistory(),
|
||||
),
|
||||
],
|
||||
@@ -864,13 +864,13 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'CPU élevé',
|
||||
'Alerte si CPU > 80% pendant 5 min',
|
||||
true,
|
||||
const Color(0xFFE17055),
|
||||
AppColors.warning,
|
||||
),
|
||||
_buildAlertItem(
|
||||
'Mémoire faible',
|
||||
'Alerte si RAM < 20% disponible',
|
||||
true,
|
||||
const Color(0xFFE17055),
|
||||
AppColors.warning,
|
||||
),
|
||||
_buildAlertItem(
|
||||
'Disque plein',
|
||||
@@ -882,7 +882,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Connexions échouées',
|
||||
'Alerte si > 100 échecs/min',
|
||||
false,
|
||||
const Color(0xFF0984E3),
|
||||
AppColors.primaryGreen,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -919,14 +919,14 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Voir tous les logs',
|
||||
'Ouvrir la console de logs complète',
|
||||
Icons.terminal,
|
||||
ColorTokens.primary,
|
||||
AppColors.primaryGreen,
|
||||
() => _viewAllLogs(),
|
||||
),
|
||||
_buildActionSetting(
|
||||
'Exporter les logs',
|
||||
'Télécharger les logs pour analyse',
|
||||
Icons.download,
|
||||
const Color(0xFF00B894),
|
||||
AppColors.success,
|
||||
() => _exportLogs(),
|
||||
),
|
||||
],
|
||||
@@ -960,7 +960,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
'Rapport détaillé',
|
||||
'Générer un rapport complet d\'utilisation',
|
||||
Icons.assessment,
|
||||
ColorTokens.primary,
|
||||
AppColors.primaryGreen,
|
||||
() => _generateUsageReport(),
|
||||
),
|
||||
],
|
||||
@@ -1053,9 +1053,9 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
child: Row(
|
||||
children: [
|
||||
if (isWarning)
|
||||
const Icon(Icons.warning, color: ColorTokens.warning, size: 20)
|
||||
const Icon(Icons.warning, color: AppColors.warning, size: 20)
|
||||
else
|
||||
const Icon(Icons.toggle_on, color: ColorTokens.primary, size: 20),
|
||||
const Icon(Icons.toggle_on, color: AppColors.primaryGreen, size: 20),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -1066,7 +1066,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isWarning ? Colors.orange[800] : const Color(0xFF1F2937),
|
||||
color: isWarning ? AppColors.warning : AppColors.textPrimaryLight,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -1082,7 +1082,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
Switch(
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
activeColor: isWarning ? ColorTokens.warning : ColorTokens.primary,
|
||||
activeColor: isWarning ? AppColors.warning : AppColors.primaryGreen,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -1108,7 +1108,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.arrow_drop_down, color: ColorTokens.primary, size: 20),
|
||||
const Icon(Icons.arrow_drop_down, color: AppColors.primaryGreen, size: 20),
|
||||
const SizedBox(width: SpacingTokens.lg),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -1119,7 +1119,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1F2937),
|
||||
color: AppColors.textPrimaryLight,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -1230,7 +1230,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1F2937),
|
||||
color: AppColors.textPrimaryLight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1266,7 +1266,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1F2937),
|
||||
color: AppColors.textPrimaryLight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1360,7 +1360,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1F2937),
|
||||
color: AppColors.textPrimaryLight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1394,7 +1394,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.bar_chart, color: ColorTokens.primary, size: 20),
|
||||
const Icon(Icons.bar_chart, color: AppColors.primaryGreen, size: 20),
|
||||
const SizedBox(width: SpacingTokens.lg),
|
||||
Expanded(
|
||||
child: Text(
|
||||
@@ -1402,7 +1402,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1F2937),
|
||||
color: AppColors.textPrimaryLight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1455,8 +1455,8 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
_showSuccessSnackBar('État du système actualisé');
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: ColorTokens.primary,
|
||||
foregroundColor: ColorTokens.onPrimary,
|
||||
backgroundColor: AppColors.primaryGreen,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
child: const Text('Actualiser'),
|
||||
),
|
||||
@@ -1507,8 +1507,8 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
_showSuccessSnackBar('Configuration exportée avec succès');
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: ColorTokens.primary,
|
||||
foregroundColor: ColorTokens.onPrimary,
|
||||
backgroundColor: AppColors.primaryGreen,
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
child: const Text('Exporter'),
|
||||
),
|
||||
@@ -1625,7 +1625,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(message),
|
||||
backgroundColor: const Color(0xFF00B894),
|
||||
backgroundColor: AppColors.success,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
);
|
||||
@@ -1636,7 +1636,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage>
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(message),
|
||||
backgroundColor: const Color(0xFFE74C3C),
|
||||
backgroundColor: AppColors.error,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user