Refactoring - Version OK
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../../shared/design_system/unionflow_design_system.dart';
|
||||
|
||||
/// Widget réutilisable pour afficher un élément d'activité
|
||||
///
|
||||
///
|
||||
/// Composant standardisé pour les listes d'activités récentes,
|
||||
/// notifications, historiques, etc.
|
||||
///
|
||||
/// REFACTORISÉ pour utiliser le Design System UnionFlow.
|
||||
class ActivityItem extends StatelessWidget {
|
||||
/// Titre principal de l'activité
|
||||
final String title;
|
||||
@@ -53,7 +56,7 @@ class ActivityItem extends StatelessWidget {
|
||||
required this.timestamp,
|
||||
this.onTap,
|
||||
}) : icon = Icons.settings,
|
||||
color = const Color(0xFF6C5CE7),
|
||||
color = ColorTokens.primary,
|
||||
type = ActivityType.system,
|
||||
style = ActivityItemStyle.normal,
|
||||
showStatusIndicator = true;
|
||||
@@ -66,7 +69,7 @@ class ActivityItem extends StatelessWidget {
|
||||
required this.timestamp,
|
||||
this.onTap,
|
||||
}) : icon = Icons.person,
|
||||
color = const Color(0xFF00B894),
|
||||
color = ColorTokens.success,
|
||||
type = ActivityType.user,
|
||||
style = ActivityItemStyle.normal,
|
||||
showStatusIndicator = true;
|
||||
@@ -79,7 +82,7 @@ class ActivityItem extends StatelessWidget {
|
||||
required this.timestamp,
|
||||
this.onTap,
|
||||
}) : icon = Icons.warning,
|
||||
color = Colors.orange,
|
||||
color = ColorTokens.warning,
|
||||
type = ActivityType.alert,
|
||||
style = ActivityItemStyle.alert,
|
||||
showStatusIndicator = true;
|
||||
@@ -339,24 +342,24 @@ class ActivityItem extends StatelessWidget {
|
||||
/// Couleur effective selon le type
|
||||
Color _getEffectiveColor() {
|
||||
if (color != null) return color!;
|
||||
|
||||
|
||||
switch (type) {
|
||||
case ActivityType.system:
|
||||
return const Color(0xFF6C5CE7);
|
||||
return ColorTokens.primary;
|
||||
case ActivityType.user:
|
||||
return const Color(0xFF00B894);
|
||||
return ColorTokens.success;
|
||||
case ActivityType.organization:
|
||||
return const Color(0xFF0984E3);
|
||||
return ColorTokens.info;
|
||||
case ActivityType.event:
|
||||
return const Color(0xFFE17055);
|
||||
return ColorTokens.secondary;
|
||||
case ActivityType.alert:
|
||||
return Colors.orange;
|
||||
return ColorTokens.warning;
|
||||
case ActivityType.error:
|
||||
return Colors.red;
|
||||
return ColorTokens.error;
|
||||
case ActivityType.success:
|
||||
return const Color(0xFF00B894);
|
||||
return ColorTokens.success;
|
||||
case null:
|
||||
return const Color(0xFF6C5CE7);
|
||||
return ColorTokens.primary;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user