108 lines
3.0 KiB
Dart
108 lines
3.0 KiB
Dart
import 'package:flutter/material.dart';
|
||
import '../tokens/unionflow_colors.dart';
|
||
|
||
/// Ligne d'activité récente — style fintech compact identique au super_admin
|
||
/// Icône dans carré arrondi 28×28 + titre + description + timestamp
|
||
class DashboardActivityRow extends StatelessWidget {
|
||
final String title;
|
||
final String description;
|
||
final String timeAgo;
|
||
final IconData icon;
|
||
final Color color;
|
||
|
||
const DashboardActivityRow({
|
||
super.key,
|
||
required this.title,
|
||
required this.description,
|
||
required this.timeAgo,
|
||
required this.icon,
|
||
required this.color,
|
||
});
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Container(
|
||
margin: const EdgeInsets.only(bottom: 6),
|
||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 9),
|
||
decoration: BoxDecoration(
|
||
color: UnionFlowColors.surface,
|
||
borderRadius: BorderRadius.circular(8),
|
||
border: Border.all(color: UnionFlowColors.border),
|
||
),
|
||
child: Row(
|
||
children: [
|
||
Container(
|
||
width: 28,
|
||
height: 28,
|
||
decoration: BoxDecoration(
|
||
color: color.withOpacity(0.12),
|
||
borderRadius: BorderRadius.circular(6),
|
||
),
|
||
child: Icon(icon, size: 14, color: color),
|
||
),
|
||
const SizedBox(width: 10),
|
||
Expanded(
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Text(
|
||
title,
|
||
style: const TextStyle(
|
||
fontSize: 12,
|
||
fontWeight: FontWeight.w600,
|
||
color: UnionFlowColors.textPrimary,
|
||
),
|
||
maxLines: 1,
|
||
overflow: TextOverflow.ellipsis,
|
||
),
|
||
Text(
|
||
description,
|
||
style: const TextStyle(
|
||
fontSize: 10,
|
||
color: UnionFlowColors.textSecondary,
|
||
),
|
||
maxLines: 1,
|
||
overflow: TextOverflow.ellipsis,
|
||
),
|
||
],
|
||
),
|
||
),
|
||
const SizedBox(width: 8),
|
||
Text(
|
||
timeAgo,
|
||
style: const TextStyle(fontSize: 10, color: UnionFlowColors.textTertiary),
|
||
),
|
||
],
|
||
),
|
||
);
|
||
}
|
||
|
||
/// Icône selon le type d'activité
|
||
static IconData iconFor(String type) {
|
||
switch (type) {
|
||
case 'member':
|
||
return Icons.person_add_rounded;
|
||
case 'event':
|
||
return Icons.event_rounded;
|
||
case 'contribution':
|
||
return Icons.payments_rounded;
|
||
default:
|
||
return Icons.circle_notifications_rounded;
|
||
}
|
||
}
|
||
|
||
/// Couleur selon le type d'activité
|
||
static Color colorFor(String type) {
|
||
switch (type) {
|
||
case 'member':
|
||
return UnionFlowColors.unionGreen;
|
||
case 'event':
|
||
return UnionFlowColors.info;
|
||
case 'contribution':
|
||
return UnionFlowColors.gold;
|
||
default:
|
||
return UnionFlowColors.textSecondary;
|
||
}
|
||
}
|
||
}
|