Uniformise les 4 onglets de gestion admin avec des composants UI partagés (header, états de liste, carte utilisateur) pour garantir une expérience cohérente sans changement backend. Co-authored-by: Cursor <cursoragent@cursor.com>
41 lines
1.1 KiB
Dart
41 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class AdminUserCard extends StatelessWidget {
|
|
final String title;
|
|
final List<String> subtitleLines;
|
|
final String? avatarUrl;
|
|
final IconData fallbackIcon;
|
|
final List<Widget> actions;
|
|
|
|
const AdminUserCard({
|
|
super.key,
|
|
required this.title,
|
|
required this.subtitleLines,
|
|
this.avatarUrl,
|
|
this.fallbackIcon = Icons.person,
|
|
this.actions = const [],
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
margin: const EdgeInsets.only(bottom: 12),
|
|
child: ListTile(
|
|
leading: CircleAvatar(
|
|
backgroundImage: avatarUrl != null ? NetworkImage(avatarUrl!) : null,
|
|
child: avatarUrl == null ? Icon(fallbackIcon) : null,
|
|
),
|
|
title: Text(title.isNotEmpty ? title : 'Sans nom'),
|
|
subtitle: Text(subtitleLines.join('\n')),
|
|
isThreeLine: subtitleLines.length > 1,
|
|
trailing: actions.isEmpty
|
|
? null
|
|
: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: actions,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|