Merge develop into master (squash)
- Ticket #92: endpoint GET /gestionnaires, dashboard admin données réelles - Seed données de test, script reset-and-seed-db.sh - Modèles frontend (Parent, AM), user_service, widgets admin Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:p_tits_pas/models/user.dart';
|
||||
import 'package:p_tits_pas/services/user_service.dart';
|
||||
|
||||
class AdminManagementWidget extends StatefulWidget {
|
||||
const AdminManagementWidget({super.key});
|
||||
|
||||
@override
|
||||
State<AdminManagementWidget> createState() => _AdminManagementWidgetState();
|
||||
}
|
||||
|
||||
class _AdminManagementWidgetState extends State<AdminManagementWidget> {
|
||||
bool _isLoading = false;
|
||||
String? _error;
|
||||
List<AppUser> _admins = [];
|
||||
List<AppUser> _filteredAdmins = [];
|
||||
final TextEditingController _searchController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadAdmins();
|
||||
_searchController.addListener(_onSearchChanged);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_searchController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _loadAdmins() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_error = null;
|
||||
});
|
||||
try {
|
||||
final list = await UserService.getAdministrateurs();
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_admins = list;
|
||||
_filteredAdmins = list;
|
||||
_isLoading = false;
|
||||
});
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_error = e.toString();
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _onSearchChanged() {
|
||||
final query = _searchController.text.toLowerCase();
|
||||
setState(() {
|
||||
_filteredAdmins = _admins.where((u) {
|
||||
final name = u.fullName.toLowerCase();
|
||||
final email = u.email.toLowerCase();
|
||||
return name.contains(query) || email.contains(query);
|
||||
}).toList();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: _searchController,
|
||||
decoration: const InputDecoration(
|
||||
hintText: "Rechercher un administrateur...",
|
||||
prefixIcon: Icon(Icons.search),
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// TODO: Créer admin
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text("Créer un admin"),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
if (_isLoading)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
else if (_error != null)
|
||||
Center(child: Text('Erreur: $_error', style: const TextStyle(color: Colors.red)))
|
||||
else if (_filteredAdmins.isEmpty)
|
||||
const Center(child: Text("Aucun administrateur trouvé."))
|
||||
else
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: _filteredAdmins.length,
|
||||
itemBuilder: (context, index) {
|
||||
final user = _filteredAdmins[index];
|
||||
return Card(
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
child: Text(user.fullName.isNotEmpty
|
||||
? user.fullName[0].toUpperCase()
|
||||
: 'A'),
|
||||
),
|
||||
title: Text(user.fullName.isNotEmpty
|
||||
? user.fullName
|
||||
: 'Sans nom'),
|
||||
subtitle: Text(user.email),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit),
|
||||
onPressed: () {},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,72 +1,142 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:p_tits_pas/models/assistante_maternelle_model.dart';
|
||||
import 'package:p_tits_pas/services/user_service.dart';
|
||||
|
||||
class AssistanteMaternelleManagementWidget extends StatelessWidget {
|
||||
class AssistanteMaternelleManagementWidget extends StatefulWidget {
|
||||
const AssistanteMaternelleManagementWidget({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final assistantes = [
|
||||
{
|
||||
"nom": "Marie Dupont",
|
||||
"numeroAgrement": "AG123456",
|
||||
"zone": "Paris 14",
|
||||
"capacite": 3,
|
||||
},
|
||||
{
|
||||
"nom": "Claire Martin",
|
||||
"numeroAgrement": "AG654321",
|
||||
"zone": "Lyon 7",
|
||||
"capacite": 2,
|
||||
},
|
||||
];
|
||||
State<AssistanteMaternelleManagementWidget> createState() =>
|
||||
_AssistanteMaternelleManagementWidgetState();
|
||||
}
|
||||
|
||||
class _AssistanteMaternelleManagementWidgetState
|
||||
extends State<AssistanteMaternelleManagementWidget> {
|
||||
bool _isLoading = false;
|
||||
String? _error;
|
||||
List<AssistanteMaternelleModel> _assistantes = [];
|
||||
List<AssistanteMaternelleModel> _filteredAssistantes = [];
|
||||
|
||||
final TextEditingController _zoneController = TextEditingController();
|
||||
final TextEditingController _capacityController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadAssistantes();
|
||||
_zoneController.addListener(_filter);
|
||||
_capacityController.addListener(_filter);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_zoneController.dispose();
|
||||
_capacityController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _loadAssistantes() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_error = null;
|
||||
});
|
||||
try {
|
||||
final list = await UserService.getAssistantesMaternelles();
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_assistantes = list;
|
||||
_filter();
|
||||
_isLoading = false;
|
||||
});
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_error = e.toString();
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _filter() {
|
||||
final zoneQuery = _zoneController.text.toLowerCase();
|
||||
final capacityQuery = int.tryParse(_capacityController.text);
|
||||
|
||||
setState(() {
|
||||
_filteredAssistantes = _assistantes.where((am) {
|
||||
final matchesZone = zoneQuery.isEmpty ||
|
||||
(am.residenceCity?.toLowerCase().contains(zoneQuery) ?? false);
|
||||
final matchesCapacity = capacityQuery == null ||
|
||||
(am.maxChildren != null && am.maxChildren! >= capacityQuery);
|
||||
return matchesZone && matchesCapacity;
|
||||
}).toList();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// 🔎 Zone de filtre
|
||||
_buildFilterSection(),
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// 🔎 Zone de filtre
|
||||
_buildFilterSection(),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 📋 Liste des assistantes
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: assistantes.length,
|
||||
itemBuilder: (context, index) {
|
||||
final assistante = assistantes[index];
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.face),
|
||||
title: Text(assistante['nom'].toString()),
|
||||
subtitle: Text(
|
||||
"N° Agrément : ${assistante['numeroAgrement']}\nZone : ${assistante['zone']} | Capacité : ${assistante['capacite']}"),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit),
|
||||
onPressed: () {
|
||||
// TODO: Ajouter modification
|
||||
},
|
||||
// 📋 Liste des assistantes
|
||||
if (_isLoading)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
else if (_error != null)
|
||||
Center(child: Text('Erreur: $_error', style: const TextStyle(color: Colors.red)))
|
||||
else if (_filteredAssistantes.isEmpty)
|
||||
const Center(child: Text("Aucune assistante maternelle trouvée."))
|
||||
else
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: _filteredAssistantes.length,
|
||||
itemBuilder: (context, index) {
|
||||
final assistante = _filteredAssistantes[index];
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundImage: assistante.user.photoUrl != null
|
||||
? NetworkImage(assistante.user.photoUrl!)
|
||||
: null,
|
||||
child: assistante.user.photoUrl == null
|
||||
? const Icon(Icons.face)
|
||||
: null,
|
||||
),
|
||||
title: Text(assistante.user.fullName.isNotEmpty
|
||||
? assistante.user.fullName
|
||||
: 'Sans nom'),
|
||||
subtitle: Text(
|
||||
"N° Agrément : ${assistante.approvalNumber ?? 'N/A'}\nZone : ${assistante.residenceCity ?? 'N/A'} | Capacité : ${assistante.maxChildren ?? 0}"),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit),
|
||||
onPressed: () {
|
||||
// TODO: Ajouter modification
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: () {
|
||||
// TODO: Ajouter suppression
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: () {
|
||||
// TODO: Ajouter suppression
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -78,26 +148,23 @@ class AssistanteMaternelleManagementWidget extends StatelessWidget {
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: TextField(
|
||||
controller: _zoneController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: "Zone géographique",
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.location_on),
|
||||
),
|
||||
onChanged: (value) {
|
||||
// TODO: Ajouter logique de filtrage par zone
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 200,
|
||||
child: TextField(
|
||||
controller: _capacityController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: "Capacité minimum",
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
onChanged: (value) {
|
||||
// TODO: Ajouter logique de filtrage par capacité
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,9 +1,70 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:p_tits_pas/models/user.dart';
|
||||
import 'package:p_tits_pas/services/user_service.dart';
|
||||
import 'package:p_tits_pas/widgets/admin/gestionnaire_card.dart';
|
||||
|
||||
class GestionnaireManagementWidget extends StatelessWidget {
|
||||
class GestionnaireManagementWidget extends StatefulWidget {
|
||||
const GestionnaireManagementWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<GestionnaireManagementWidget> createState() =>
|
||||
_GestionnaireManagementWidgetState();
|
||||
}
|
||||
|
||||
class _GestionnaireManagementWidgetState
|
||||
extends State<GestionnaireManagementWidget> {
|
||||
bool _isLoading = false;
|
||||
String? _error;
|
||||
List<AppUser> _gestionnaires = [];
|
||||
List<AppUser> _filteredGestionnaires = [];
|
||||
final TextEditingController _searchController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadGestionnaires();
|
||||
_searchController.addListener(_onSearchChanged);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_searchController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _loadGestionnaires() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_error = null;
|
||||
});
|
||||
try {
|
||||
final list = await UserService.getGestionnaires();
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_gestionnaires = list;
|
||||
_filteredGestionnaires = list;
|
||||
_isLoading = false;
|
||||
});
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_error = e.toString();
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _onSearchChanged() {
|
||||
final query = _searchController.text.toLowerCase();
|
||||
setState(() {
|
||||
_filteredGestionnaires = _gestionnaires.where((u) {
|
||||
final name = u.fullName.toLowerCase();
|
||||
final email = u.email.toLowerCase();
|
||||
return name.contains(query) || email.contains(query);
|
||||
}).toList();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
@@ -14,9 +75,10 @@ class GestionnaireManagementWidget extends StatelessWidget {
|
||||
// 🔹 Barre du haut avec bouton
|
||||
Row(
|
||||
children: [
|
||||
const Expanded(
|
||||
Expanded(
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
controller: _searchController,
|
||||
decoration: const InputDecoration(
|
||||
hintText: "Rechercher un gestionnaire...",
|
||||
prefixIcon: Icon(Icons.search),
|
||||
border: OutlineInputBorder(),
|
||||
@@ -26,7 +88,7 @@ class GestionnaireManagementWidget extends StatelessWidget {
|
||||
const SizedBox(width: 16),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// Rediriger vers la page de création
|
||||
// TODO: Rediriger vers la page de création
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text("Créer un gestionnaire"),
|
||||
@@ -36,17 +98,25 @@ class GestionnaireManagementWidget extends StatelessWidget {
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// 🔹 Liste des gestionnaires
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: 5, // À remplacer par liste dynamique
|
||||
itemBuilder: (context, index) {
|
||||
return GestionnaireCard(
|
||||
name: "Dupont $index",
|
||||
email: "dupont$index@mail.com",
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
if (_isLoading)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
else if (_error != null)
|
||||
Center(child: Text('Erreur: $_error', style: const TextStyle(color: Colors.red)))
|
||||
else if (_filteredGestionnaires.isEmpty)
|
||||
const Center(child: Text("Aucun gestionnaire trouvé."))
|
||||
else
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: _filteredGestionnaires.length,
|
||||
itemBuilder: (context, index) {
|
||||
final user = _filteredGestionnaires[index];
|
||||
return GestionnaireCard(
|
||||
name: user.fullName.isNotEmpty ? user.fullName : "Sans nom",
|
||||
email: user.email,
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,83 +1,149 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:p_tits_pas/models/parent_model.dart';
|
||||
import 'package:p_tits_pas/services/user_service.dart';
|
||||
|
||||
class ParentManagementWidget extends StatelessWidget {
|
||||
class ParentManagementWidget extends StatefulWidget {
|
||||
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,
|
||||
},
|
||||
];
|
||||
State<ParentManagementWidget> createState() => _ParentManagementWidgetState();
|
||||
}
|
||||
|
||||
class _ParentManagementWidgetState extends State<ParentManagementWidget> {
|
||||
bool _isLoading = false;
|
||||
String? _error;
|
||||
List<ParentModel> _parents = [];
|
||||
List<ParentModel> _filteredParents = [];
|
||||
|
||||
final TextEditingController _searchController = TextEditingController();
|
||||
String? _selectedStatus;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadParents();
|
||||
_searchController.addListener(_filter);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_searchController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _loadParents() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_error = null;
|
||||
});
|
||||
try {
|
||||
final list = await UserService.getParents();
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_parents = list;
|
||||
_filter(); // Apply initial filter (if any)
|
||||
_isLoading = false;
|
||||
});
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_error = e.toString();
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _filter() {
|
||||
final query = _searchController.text.toLowerCase();
|
||||
setState(() {
|
||||
_filteredParents = _parents.where((p) {
|
||||
final matchesName = p.user.fullName.toLowerCase().contains(query) ||
|
||||
p.user.email.toLowerCase().contains(query);
|
||||
final matchesStatus = _selectedStatus == null ||
|
||||
_selectedStatus == 'Tous' ||
|
||||
(p.user.statut?.toLowerCase() == _selectedStatus?.toLowerCase());
|
||||
|
||||
// Mapping simple pour le statut affiché vs backend
|
||||
// Backend: en_attente, actif, suspendu
|
||||
// Dropdown: En attente, Actif, Suspendu
|
||||
|
||||
return matchesName && matchesStatus;
|
||||
}).toList();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
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
|
||||
},
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildSearchSection(),
|
||||
const SizedBox(height: 16),
|
||||
if (_isLoading)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
else if (_error != null)
|
||||
Center(child: Text('Erreur: $_error', style: const TextStyle(color: Colors.red)))
|
||||
else if (_filteredParents.isEmpty)
|
||||
const Center(child: Text("Aucun parent trouvé."))
|
||||
else
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: _filteredParents.length,
|
||||
itemBuilder: (context, index) {
|
||||
final parent = _filteredParents[index];
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundImage: parent.user.photoUrl != null
|
||||
? NetworkImage(parent.user.photoUrl!)
|
||||
: null,
|
||||
child: parent.user.photoUrl == null
|
||||
? const Icon(Icons.person)
|
||||
: null,
|
||||
),
|
||||
title: Text(parent.user.fullName.isNotEmpty
|
||||
? parent.user.fullName
|
||||
: 'Sans nom'),
|
||||
subtitle: Text(
|
||||
"${parent.user.email}\nStatut : ${parent.user.statut ?? 'Inconnu'} | Enfants : ${parent.childrenCount}",
|
||||
),
|
||||
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
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.edit),
|
||||
tooltip: "Modifier",
|
||||
onPressed: () {
|
||||
// TODO: Modifier parent
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete),
|
||||
tooltip: "Supprimer",
|
||||
onPressed: () {
|
||||
// TODO: Supprimer compte
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,13 +155,12 @@ class ParentManagementWidget extends StatelessWidget {
|
||||
SizedBox(
|
||||
width: 220,
|
||||
child: TextField(
|
||||
controller: _searchController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: "Nom du parent",
|
||||
border: OutlineInputBorder(),
|
||||
prefixIcon: Icon(Icons.search),
|
||||
),
|
||||
onChanged: (value) {
|
||||
// TODO: Ajouter logique de recherche
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@@ -105,13 +170,18 @@ class ParentManagementWidget extends StatelessWidget {
|
||||
labelText: "Statut",
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
value: _selectedStatus,
|
||||
items: const [
|
||||
DropdownMenuItem(value: "Actif", child: Text("Actif")),
|
||||
DropdownMenuItem(value: "En attente", child: Text("En attente")),
|
||||
DropdownMenuItem(value: "Supprimé", child: Text("Supprimé")),
|
||||
DropdownMenuItem(value: null, child: Text("Tous")),
|
||||
DropdownMenuItem(value: "actif", child: Text("Actif")),
|
||||
DropdownMenuItem(value: "en_attente", child: Text("En attente")),
|
||||
DropdownMenuItem(value: "suspendu", child: Text("Suspendu")),
|
||||
],
|
||||
onChanged: (value) {
|
||||
// TODO: Ajouter logique de filtrage
|
||||
setState(() {
|
||||
_selectedStatus = value;
|
||||
_filter();
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user