feat(auth): restore authenticated user profile

This commit is contained in:
SaidSoighiri94
2026-07-23 14:39:35 +02:00
parent dc208fa13a
commit 36224f30ee
8 changed files with 276 additions and 76 deletions
@@ -1,7 +1,6 @@
import "package:flutter/material.dart";
import "package:google_fonts/google_fonts.dart";
import "../demo_identity.dart";
import "../services/auth_service.dart";
import "../services/responsable_service.dart";
import "../theme/ensup_colors.dart";
@@ -463,6 +462,12 @@ class _ResponsableTopBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
final profile = AuthService.currentProfile;
final campusTag = profile?.campusTag ?? "Ensitech · Cergy";
final initials = profile?.initials ?? "KB";
final userName = profile?.fullName ?? "Karim Benali";
final roleLabel = profile?.roleLabel ?? "Responsable matériel";
return Container(
height: 68,
padding: const EdgeInsets.symmetric(horizontal: 20),
@@ -533,7 +538,7 @@ class _ResponsableTopBar extends StatelessWidget {
),
const SizedBox(width: 6),
Text(
DemoIdentity.loginCampusTag,
campusTag,
style: GoogleFonts.titilliumWeb(
fontSize: 12,
fontWeight: FontWeight.w600,
@@ -565,7 +570,7 @@ class _ResponsableTopBar extends StatelessWidget {
shape: BoxShape.circle,
),
child: Text(
"KB",
initials,
style: GoogleFonts.darkerGrotesque(
color: Colors.white,
fontSize: 13,
@@ -580,7 +585,7 @@ class _ResponsableTopBar extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Karim Benali",
userName,
style: GoogleFonts.titilliumWeb(
fontSize: 13,
fontWeight: FontWeight.w700,
@@ -588,7 +593,7 @@ class _ResponsableTopBar extends StatelessWidget {
),
),
Text(
"Responsable matériel",
roleLabel,
style: GoogleFonts.titilliumWeb(
fontSize: 11,
color: EnsupColors.muted,