122 lines
3.5 KiB
Dart
122 lines
3.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ParentManagementWidget extends StatelessWidget {
|
|
const ParentManagementWidget({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// 🔁 Simulation de données parents
|
|
final parents = [
|
|
{
|
|
"nom": "Jean Dupuis",
|
|
"email": "jean.dupuis@email.com",
|
|
"statut": "Actif",
|
|
"enfants": 2,
|
|
},
|
|
{
|
|
"nom": "Lucie Morel",
|
|
"email": "lucie.morel@email.com",
|
|
"statut": "En attente",
|
|
"enfants": 1,
|
|
},
|
|
];
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
|
|
_buildSearchSection(),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
ListView.builder(
|
|
shrinkWrap: true,
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
itemCount: parents.length,
|
|
itemBuilder: (context, index) {
|
|
final parent = parents[index];
|
|
return Card(
|
|
margin: const EdgeInsets.symmetric(vertical: 8),
|
|
child: ListTile(
|
|
leading: const Icon(Icons.person_outline),
|
|
title: Text(parent['nom'].toString()),
|
|
subtitle: Text(
|
|
"${parent['email']}\nStatut : ${parent['statut']} | Enfants : ${parent['enfants']}",
|
|
),
|
|
isThreeLine: true,
|
|
trailing: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
IconButton(
|
|
icon: const Icon(Icons.visibility),
|
|
tooltip: "Voir dossier",
|
|
onPressed: () {
|
|
// TODO: Voir le statut du dossier
|
|
},
|
|
),
|
|
IconButton(
|
|
icon: const Icon(Icons.edit),
|
|
tooltip: "Modifier",
|
|
onPressed: () {
|
|
// TODO: Modifier parent
|
|
},
|
|
),
|
|
IconButton(
|
|
icon: const Icon(Icons.delete),
|
|
tooltip: "Supprimer",
|
|
onPressed: () {
|
|
// TODO: Supprimer compte
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
],
|
|
)
|
|
);
|
|
}
|
|
|
|
Widget _buildSearchSection() {
|
|
return Wrap(
|
|
spacing: 16,
|
|
runSpacing: 8,
|
|
children: [
|
|
SizedBox(
|
|
width: 220,
|
|
child: TextField(
|
|
decoration: const InputDecoration(
|
|
labelText: "Nom du parent",
|
|
border: OutlineInputBorder(),
|
|
),
|
|
onChanged: (value) {
|
|
// TODO: Ajouter logique de recherche
|
|
},
|
|
),
|
|
),
|
|
SizedBox(
|
|
width: 220,
|
|
child: DropdownButtonFormField<String>(
|
|
decoration: const InputDecoration(
|
|
labelText: "Statut",
|
|
border: OutlineInputBorder(),
|
|
),
|
|
items: const [
|
|
DropdownMenuItem(value: "Actif", child: Text("Actif")),
|
|
DropdownMenuItem(value: "En attente", child: Text("En attente")),
|
|
DropdownMenuItem(value: "Supprimé", child: Text("Supprimé")),
|
|
],
|
|
onChanged: (value) {
|
|
// TODO: Ajouter logique de filtrage
|
|
},
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|