feat: Bandeau générique, dashboards et doc (squash develop, Closes #100)
- Bandeau générique (DashboardBandeau) pour Parent, Admin, Gestionnaire, AM - ParentDashboardScreen, AdminDashboardScreen, GestionnaireDashboardScreen, AM dashboard - AppFooter responsive, scripts Gitea (create/list issues parent API) - Doc: ticket #101 Inscription Parent API, mise à jour 23_LISTE-TICKETS - User.fromJson robustesse (nullable id/email/role) - Suppression dashboard_app_bar.dart au profit de dashboard_bandeau.dart Refs: #100, #101 Made-with: Cursor
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:p_tits_pas/widgets/admin/dashboard_admin.dart';
|
||||
import 'package:p_tits_pas/models/user.dart';
|
||||
import 'package:p_tits_pas/services/auth_service.dart';
|
||||
import 'package:p_tits_pas/widgets/admin/user_management_panel.dart';
|
||||
import 'package:p_tits_pas/widgets/app_footer.dart';
|
||||
import 'package:p_tits_pas/widgets/dashboard/dashboard_bandeau.dart';
|
||||
|
||||
/// Dashboard gestionnaire – même shell que l'admin, sans onglet Paramètres.
|
||||
/// Réutilise [UserManagementPanel].
|
||||
@@ -14,24 +16,47 @@ class GestionnaireDashboardScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _GestionnaireDashboardScreenState extends State<GestionnaireDashboardScreen> {
|
||||
AppUser? _user;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadUser();
|
||||
}
|
||||
|
||||
Future<void> _loadUser() async {
|
||||
final user = await AuthService.getCurrentUser();
|
||||
if (mounted) setState(() => _user = user);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(60.0),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
),
|
||||
child: DashboardAppBarAdmin(
|
||||
selectedIndex: 0,
|
||||
onTabChange: (_) {},
|
||||
showSettingsTab: false,
|
||||
roleLabel: 'Gestionnaire',
|
||||
setupCompleted: true,
|
||||
),
|
||||
child: DashboardBandeau(
|
||||
tabItems: const [
|
||||
DashboardTabItem(label: 'Gestion des utilisateurs'),
|
||||
],
|
||||
selectedTabIndex: 0,
|
||||
onTabSelected: (_) {},
|
||||
userDisplayName: _user?.fullName.isNotEmpty == true
|
||||
? _user!.fullName
|
||||
: 'Gestionnaire',
|
||||
userEmail: _user?.email,
|
||||
userRole: _user?.role,
|
||||
onProfileTap: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Modification du profil – à venir')),
|
||||
);
|
||||
},
|
||||
onSettingsTap: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Paramètres – à venir')),
|
||||
);
|
||||
},
|
||||
onLogout: () {},
|
||||
showLogoutConfirmation: true,
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
|
||||
Reference in New Issue
Block a user