Intègre un bandeau unique (onglets à gauche, recherche/filtre en pilule, bouton Ajouter à droite) et compacte les cartes Parents/AM avec ouverture d’une modale complète sur Modifier (croix, actions Modifier/Supprimer). Co-authored-by: Cursor <cursoragent@cursor.com>
93 lines
2.8 KiB
Dart
93 lines
2.8 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),
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(8),
|
|
side: BorderSide(color: Colors.grey.shade300),
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
|
child: Row(
|
|
children: [
|
|
CircleAvatar(
|
|
radius: 14,
|
|
backgroundColor: const Color(0xFFEDE5FA),
|
|
backgroundImage:
|
|
avatarUrl != null ? NetworkImage(avatarUrl!) : null,
|
|
child: avatarUrl == null
|
|
? Icon(
|
|
fallbackIcon,
|
|
size: 16,
|
|
color: const Color(0xFF6B3FA0),
|
|
)
|
|
: null,
|
|
),
|
|
const SizedBox(width: 10),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title.isNotEmpty ? title : 'Sans nom',
|
|
style: const TextStyle(
|
|
fontWeight: FontWeight.w600,
|
|
fontSize: 14,
|
|
),
|
|
),
|
|
const SizedBox(height: 2),
|
|
...subtitleLines.map(
|
|
(line) => Text(
|
|
line,
|
|
style: const TextStyle(
|
|
color: Colors.black54,
|
|
fontSize: 12,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
if (actions.isNotEmpty)
|
|
IconTheme(
|
|
data: const IconThemeData(size: 18),
|
|
child: IconButtonTheme(
|
|
data: IconButtonThemeData(
|
|
style: IconButton.styleFrom(
|
|
visualDensity: VisualDensity.compact,
|
|
padding: const EdgeInsets.all(4),
|
|
minimumSize: const Size(28, 28),
|
|
),
|
|
),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: actions,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|