From e492220af437b043e8ccb5bdad3da94b580b59bb Mon Sep 17 00:00:00 2001 From: SaidSoighiri94 Date: Mon, 6 Jul 2026 11:05:53 +0200 Subject: [PATCH] feat(frontend): add ENSUP brand corners to home screen --- eme-frontend/lib/screens/home_screen.dart | 159 ++++++++++---------- eme-frontend/lib/widgets/brand_corners.dart | 66 ++++++++ 2 files changed, 149 insertions(+), 76 deletions(-) create mode 100644 eme-frontend/lib/widgets/brand_corners.dart diff --git a/eme-frontend/lib/screens/home_screen.dart b/eme-frontend/lib/screens/home_screen.dart index ff2da71..eefa8f9 100644 --- a/eme-frontend/lib/screens/home_screen.dart +++ b/eme-frontend/lib/screens/home_screen.dart @@ -4,6 +4,7 @@ import "../theme/ensup_colors.dart"; import "../widgets/ensup_top_bar.dart"; import "../widgets/profile_card.dart"; import "../widgets/action_card.dart"; +import "../widgets/brand_corners.dart"; /// Écran d'accueil étudiant : profil + choix Emprunter / Restituer. class HomeScreen extends StatelessWidget { @@ -19,86 +20,92 @@ class HomeScreen extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( backgroundColor: EnsupColors.soft, - body: 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( - campusTag: "Paris · Ensitech", - userName: "Lucas Martin", - userInitials: "LM", - ), - Expanded( - child: SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 28), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const ProfileCard( - name: "Lucas Martin", - subtitle: "Étudiant · BTS SIO 2ème année · Ensitech Paris", - initials: "LM", - ), - const SizedBox(height: 24), - Text( - "Que souhaitez-vous faire ?", - style: GoogleFonts.darkerGrotesque( - fontSize: 28, - fontWeight: FontWeight.w900, - color: EnsupColors.text, - ), - ), - const SizedBox(height: 18), - IntrinsicHeight( - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - child: ActionCard( - icon: Icons.inventory_2_outlined, - title: "EMPRUNTER", - description: - "Accéder au catalogue et emprunter du matériel éducatif", - color: EnsupColors.cyan, - onTap: () => _bientot(context, "Emprunter"), - ), - ), - const SizedBox(width: 16), - Expanded( - child: ActionCard( - icon: Icons.assignment_return_outlined, - title: "RESTITUER", - description: "Restituer un matériel que vous avez emprunté", - color: EnsupColors.teal, - onTap: () => _bientot(context, "Restituer"), - ), - ), - ], - ), - ), - ], + 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( + campusTag: "Paris · Ensitech", + userName: "Lucas Martin", + userInitials: "LM", + ), + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 28), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const ProfileCard( + name: "Lucas Martin", + subtitle: "Étudiant · BTS SIO 2ème année · Ensitech Paris", + initials: "LM", + ), + const SizedBox(height: 24), + Text( + "Que souhaitez-vous faire ?", + style: GoogleFonts.darkerGrotesque( + fontSize: 28, + fontWeight: FontWeight.w900, + color: EnsupColors.text, + ), + ), + const SizedBox(height: 18), + IntrinsicHeight( + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + child: ActionCard( + icon: Icons.inventory_2_outlined, + title: "EMPRUNTER", + description: + "Accéder au catalogue et emprunter du matériel éducatif", + color: EnsupColors.cyan, + onTap: () => _bientot(context, "Emprunter"), + ), + ), + const SizedBox(width: 16), + Expanded( + child: ActionCard( + icon: Icons.assignment_return_outlined, + title: "RESTITUER", + description: + "Restituer un matériel que vous avez emprunté", + color: EnsupColors.teal, + onTap: () => _bientot(context, "Restituer"), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), ), ), - ), + const Positioned.fill(child: BrandCorners()), + ], ), ); } diff --git a/eme-frontend/lib/widgets/brand_corners.dart b/eme-frontend/lib/widgets/brand_corners.dart new file mode 100644 index 0000000..7be1075 --- /dev/null +++ b/eme-frontend/lib/widgets/brand_corners.dart @@ -0,0 +1,66 @@ +import "package:flutter/material.dart"; +import "../theme/ensup_colors.dart"; + +/// Coins décoratifs de la charte ENSUP : un L coloré en haut-gauche et en +/// bas-droit, en surimpression et non cliquables (comme dans la maquette). +class BrandCorners extends StatelessWidget { + const BrandCorners({super.key}); + + @override + Widget build(BuildContext context) { + return IgnorePointer( + child: Stack( + children: [ + Positioned( + top: 0, + left: 0, + child: CustomPaint(size: const Size(120, 120), painter: _TopLeftCornerPainter()), + ), + Positioned( + bottom: 0, + right: 0, + child: CustomPaint(size: const Size(120, 120), painter: _BottomRightCornerPainter()), + ), + ], + ), + ); + } +} + +const double _thickness = 22; + +class _TopLeftCornerPainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + final paint = Paint()..color = EnsupColors.red; + // Barre verticale gauche (rouge) + segment haut rouge. + canvas.drawRect(Rect.fromLTWH(0, 0, _thickness, size.height), paint); + canvas.drawRect(const Rect.fromLTWH(0, 0, 28, _thickness), paint); + // Segments colorés de la barre horizontale. + paint.color = EnsupColors.purple; + canvas.drawRect(const Rect.fromLTWH(28, 0, 22, _thickness), paint); + paint.color = EnsupColors.teal; + canvas.drawRect(const Rect.fromLTWH(50, 0, 22, _thickness), paint); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +} + +class _BottomRightCornerPainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + final paint = Paint()..color = EnsupColors.cyan; + // Barre verticale droite (cyan) + segment bas cyan. + canvas.drawRect(Rect.fromLTWH(size.width - _thickness, 0, _thickness, size.height), paint); + canvas.drawRect(Rect.fromLTWH(size.width - 28, size.height - _thickness, 28, _thickness), paint); + // Segments colorés de la barre horizontale. + paint.color = EnsupColors.blue2; + canvas.drawRect(Rect.fromLTWH(size.width - 50, size.height - _thickness, 22, _thickness), paint); + paint.color = EnsupColors.blue3; + canvas.drawRect(Rect.fromLTWH(size.width - 72, size.height - _thickness, 22, _thickness), paint); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) => false; +}