feat(frontend): add student identification screen as entry point
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
import "theme/ensup_theme.dart";
|
import "theme/ensup_theme.dart";
|
||||||
import "screens/home_screen.dart";
|
import "screens/login_screen.dart";
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const EmeApp());
|
runApp(const EmeApp());
|
||||||
@@ -15,7 +15,7 @@ class EmeApp extends StatelessWidget {
|
|||||||
title: "EME — Emprunt Matériel ENSUP",
|
title: "EME — Emprunt Matériel ENSUP",
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
theme: buildEnsupTheme(),
|
theme: buildEnsupTheme(),
|
||||||
home: const HomeScreen(),
|
home: const LoginScreen(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,175 @@
|
|||||||
|
import "package:flutter/material.dart";
|
||||||
|
import "package:google_fonts/google_fonts.dart";
|
||||||
|
import "../theme/ensup_colors.dart";
|
||||||
|
import "../widgets/ensup_top_bar.dart";
|
||||||
|
import "../widgets/identification_option.dart";
|
||||||
|
import "../widgets/brand_corners.dart";
|
||||||
|
import "home_screen.dart";
|
||||||
|
|
||||||
|
/// Écran de démarrage : identification de l'étudiant (RG01/RG02).
|
||||||
|
class LoginScreen extends StatelessWidget {
|
||||||
|
const LoginScreen({super.key});
|
||||||
|
|
||||||
|
void _identifier(BuildContext context) {
|
||||||
|
Navigator.of(context).push(
|
||||||
|
MaterialPageRoute(builder: (_) => const HomeScreen()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: EnsupColors.soft,
|
||||||
|
body: Stack(
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 1280, maxHeight: 820),
|
||||||
|
child: Container(
|
||||||
|
margin: const EdgeInsets.all(24),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(16),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: EnsupColors.text.withValues(alpha: 0.14),
|
||||||
|
blurRadius: 60,
|
||||||
|
offset: const Offset(0, 18),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const EnsupTopBar(
|
||||||
|
brandText: "EME — Emprunt Matériel ENSUP",
|
||||||
|
campusTag: "Ensitech · Paris",
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: DecoratedBox(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
gradient: LinearGradient(
|
||||||
|
begin: Alignment.topLeft,
|
||||||
|
end: Alignment.bottomRight,
|
||||||
|
colors: [Color(0xFFF0F6FF), Color(0xFFF8FAFC)],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 40),
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 560),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 72,
|
||||||
|
height: 72,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: const LinearGradient(
|
||||||
|
colors: [EnsupColors.blue3, EnsupColors.cyan],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(22),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: EnsupColors.blue3.withValues(alpha: 0.35),
|
||||||
|
blurRadius: 24,
|
||||||
|
offset: const Offset(0, 8),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: const Icon(Icons.badge_outlined, color: Colors.white, size: 34),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Text(
|
||||||
|
"Bienvenue sur EME",
|
||||||
|
style: GoogleFonts.darkerGrotesque(
|
||||||
|
fontSize: 34,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
|
color: EnsupColors.text,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
"Emprunt Matériel ENSUP · Accès réservé aux membres du groupe ENSUP",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: GoogleFonts.titilliumWeb(
|
||||||
|
fontSize: 14,
|
||||||
|
color: EnsupColors.muted,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 28),
|
||||||
|
IdentificationOption(
|
||||||
|
icon: Icons.qr_code_2,
|
||||||
|
iconColor: EnsupColors.cyan,
|
||||||
|
label: "Scanner ma carte étudiante",
|
||||||
|
description:
|
||||||
|
"Présentez votre carte étudiante dématérialisée à la douchette ou à la tablette",
|
||||||
|
onTap: () => _identifier(context),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
IdentificationOption(
|
||||||
|
icon: Icons.mail_outline,
|
||||||
|
iconColor: EnsupColors.teal,
|
||||||
|
label: "Connexion compte professionnel ENSUP",
|
||||||
|
description: "Utiliser mon adresse e-mail Microsoft 365",
|
||||||
|
onTap: () => _identifier(context),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
const Expanded(child: Divider(color: EnsupColors.line)),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
|
child: Text(
|
||||||
|
"ou",
|
||||||
|
style: GoogleFonts.titilliumWeb(
|
||||||
|
fontSize: 12,
|
||||||
|
color: EnsupColors.muted,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Expanded(child: Divider(color: EnsupColors.line)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: OutlinedButton.icon(
|
||||||
|
onPressed: () {},
|
||||||
|
icon: const Icon(Icons.person_outline, size: 16),
|
||||||
|
label: Text(
|
||||||
|
"Accès responsable matériel",
|
||||||
|
style: GoogleFonts.darkerGrotesque(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
foregroundColor: EnsupColors.text2,
|
||||||
|
side: const BorderSide(color: EnsupColors.line, width: 1.5),
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Positioned.fill(child: BrandCorners()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,21 +2,27 @@ import "package:flutter/material.dart";
|
|||||||
import "package:google_fonts/google_fonts.dart";
|
import "package:google_fonts/google_fonts.dart";
|
||||||
import "../theme/ensup_colors.dart";
|
import "../theme/ensup_colors.dart";
|
||||||
|
|
||||||
/// Barre supérieure ENSUP : marque EME, campus et utilisateur connecté.
|
/// Barre supérieure ENSUP. L'utilisateur est optionnel (absent sur l'écran
|
||||||
|
/// d'identification, présent une fois l'étudiant connecté).
|
||||||
class EnsupTopBar extends StatelessWidget {
|
class EnsupTopBar extends StatelessWidget {
|
||||||
const EnsupTopBar({
|
const EnsupTopBar({
|
||||||
super.key,
|
super.key,
|
||||||
|
this.brandText = "EME",
|
||||||
required this.campusTag,
|
required this.campusTag,
|
||||||
required this.userName,
|
this.userName,
|
||||||
required this.userInitials,
|
this.userInitials,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final String brandText;
|
||||||
final String campusTag;
|
final String campusTag;
|
||||||
final String userName;
|
final String? userName;
|
||||||
final String userInitials;
|
final String? userInitials;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final name = userName;
|
||||||
|
final initials = userInitials;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
height: 56,
|
height: 56,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 28),
|
padding: const EdgeInsets.symmetric(horizontal: 28),
|
||||||
@@ -26,10 +32,10 @@ class EnsupTopBar extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.devices_other, color: Colors.white, size: 18),
|
const Icon(Icons.badge_outlined, color: Colors.white, size: 18),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Text(
|
Text(
|
||||||
"EME",
|
brandText,
|
||||||
style: GoogleFonts.darkerGrotesque(
|
style: GoogleFonts.darkerGrotesque(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.w900,
|
fontWeight: FontWeight.w900,
|
||||||
@@ -57,17 +63,19 @@ class EnsupTopBar extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
if (name != null && initials != null) ...[
|
||||||
_Avatar(initials: userInitials),
|
const SizedBox(width: 12),
|
||||||
const SizedBox(width: 8),
|
_Avatar(initials: initials),
|
||||||
Text(
|
const SizedBox(width: 8),
|
||||||
userName,
|
Text(
|
||||||
style: GoogleFonts.titilliumWeb(
|
name,
|
||||||
color: Colors.white,
|
style: GoogleFonts.titilliumWeb(
|
||||||
fontSize: 13,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.w600,
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
import "package:flutter/material.dart";
|
||||||
|
import "package:google_fonts/google_fonts.dart";
|
||||||
|
import "../theme/ensup_colors.dart";
|
||||||
|
|
||||||
|
/// Option d'identification de l'écran de connexion (QR ou mail ENSUP).
|
||||||
|
class IdentificationOption extends StatelessWidget {
|
||||||
|
const IdentificationOption({
|
||||||
|
super.key,
|
||||||
|
required this.icon,
|
||||||
|
required this.iconColor,
|
||||||
|
required this.label,
|
||||||
|
required this.description,
|
||||||
|
this.onTap,
|
||||||
|
});
|
||||||
|
|
||||||
|
final IconData icon;
|
||||||
|
final Color iconColor;
|
||||||
|
final String label;
|
||||||
|
final String description;
|
||||||
|
final VoidCallback? onTap;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return InkWell(
|
||||||
|
onTap: onTap,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 18),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
border: Border.all(color: EnsupColors.line, width: 2),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 48,
|
||||||
|
height: 48,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: iconColor.withValues(alpha: 0.1),
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Icon(icon, color: iconColor, size: 24),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 16),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
label,
|
||||||
|
style: GoogleFonts.darkerGrotesque(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 18,
|
||||||
|
color: EnsupColors.text,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 3),
|
||||||
|
Text(
|
||||||
|
description,
|
||||||
|
style: GoogleFonts.titilliumWeb(
|
||||||
|
fontSize: 12,
|
||||||
|
color: EnsupColors.muted,
|
||||||
|
height: 1.4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Icon(Icons.chevron_right, color: EnsupColors.muted, size: 20),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,10 +2,10 @@ import "package:flutter_test/flutter_test.dart";
|
|||||||
import "package:eme_frontend/main.dart";
|
import "package:eme_frontend/main.dart";
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets("L'accueil affiche les actions Emprunter et Restituer", (tester) async {
|
testWidgets("L'écran de démarrage affiche l'identification", (tester) async {
|
||||||
await tester.pumpWidget(const EmeApp());
|
await tester.pumpWidget(const EmeApp());
|
||||||
|
|
||||||
expect(find.text("EMPRUNTER"), findsOneWidget);
|
expect(find.text("Bienvenue sur EME"), findsOneWidget);
|
||||||
expect(find.text("RESTITUER"), findsOneWidget);
|
expect(find.text("Scanner ma carte étudiante"), findsOneWidget);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,6 +177,11 @@ En terminal interactif (VS Code), `migrate dev` fonctionne normalement (taper `y
|
|||||||
- Références mises à jour dans `CLAUDE.md` et `CONTEXT.md` pour pointer vers la maquette.
|
- Références mises à jour dans `CLAUDE.md` et `CONTEXT.md` pour pointer vers la maquette.
|
||||||
- Le PDF reste récupérable dans l'historique Git si besoin (logo officiel source).
|
- Le PDF reste récupérable dans l'historique Git si besoin (logo officiel source).
|
||||||
|
|
||||||
|
### Étape 23 — Frontend : écran d'identification (écran de démarrage)
|
||||||
|
- Correction : l'écran de démarrage est l'identification (`s-login` de la maquette), pas l'accueil étudiant. Logo, "Bienvenue sur EME", deux options (scanner carte / compte ENSUP Microsoft 365), bouton accès responsable.
|
||||||
|
- `EnsupTopBar` rendue réutilisable (utilisateur optionnel, marque paramétrable) ; nouveau widget `IdentificationOption` ; coins ENSUP aussi sur cet écran.
|
||||||
|
- Navigation identification -> accueil étudiant (`HomeScreen`).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Dette technique en attente
|
## Dette technique en attente
|
||||||
@@ -192,4 +197,4 @@ En terminal interactif (VS Code), `migrate dev` fonctionne normalement (taper `y
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
*Dernière mise à jour : 2026-07-06 — Frontend Flutter (accueil ENSUP) ; PDF de charte retiré au profit de la maquette.*
|
*Dernière mise à jour : 2026-07-06 — Frontend : écran d'identification (démarrage) + accueil étudiant.*
|
||||||
|
|||||||
Reference in New Issue
Block a user