feat(frontend): add ENSUP brand corners to home screen
This commit is contained in:
@@ -4,6 +4,7 @@ import "../theme/ensup_colors.dart";
|
|||||||
import "../widgets/ensup_top_bar.dart";
|
import "../widgets/ensup_top_bar.dart";
|
||||||
import "../widgets/profile_card.dart";
|
import "../widgets/profile_card.dart";
|
||||||
import "../widgets/action_card.dart";
|
import "../widgets/action_card.dart";
|
||||||
|
import "../widgets/brand_corners.dart";
|
||||||
|
|
||||||
/// Écran d'accueil étudiant : profil + choix Emprunter / Restituer.
|
/// Écran d'accueil étudiant : profil + choix Emprunter / Restituer.
|
||||||
class HomeScreen extends StatelessWidget {
|
class HomeScreen extends StatelessWidget {
|
||||||
@@ -19,7 +20,9 @@ class HomeScreen extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: EnsupColors.soft,
|
backgroundColor: EnsupColors.soft,
|
||||||
body: Center(
|
body: Stack(
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
child: ConstrainedBox(
|
child: ConstrainedBox(
|
||||||
constraints: const BoxConstraints(maxWidth: 1280, maxHeight: 820),
|
constraints: const BoxConstraints(maxWidth: 1280, maxHeight: 820),
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -83,7 +86,8 @@ class HomeScreen extends StatelessWidget {
|
|||||||
child: ActionCard(
|
child: ActionCard(
|
||||||
icon: Icons.assignment_return_outlined,
|
icon: Icons.assignment_return_outlined,
|
||||||
title: "RESTITUER",
|
title: "RESTITUER",
|
||||||
description: "Restituer un matériel que vous avez emprunté",
|
description:
|
||||||
|
"Restituer un matériel que vous avez emprunté",
|
||||||
color: EnsupColors.teal,
|
color: EnsupColors.teal,
|
||||||
onTap: () => _bientot(context, "Restituer"),
|
onTap: () => _bientot(context, "Restituer"),
|
||||||
),
|
),
|
||||||
@@ -100,6 +104,9 @@ class HomeScreen extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const Positioned.fill(child: BrandCorners()),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user