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,86 +20,92 @@ 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(
|
||||||
child: ConstrainedBox(
|
children: [
|
||||||
constraints: const BoxConstraints(maxWidth: 1280, maxHeight: 820),
|
Center(
|
||||||
child: Container(
|
child: ConstrainedBox(
|
||||||
margin: const EdgeInsets.all(24),
|
constraints: const BoxConstraints(maxWidth: 1280, maxHeight: 820),
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Colors.white,
|
margin: const EdgeInsets.all(24),
|
||||||
borderRadius: BorderRadius.circular(16),
|
decoration: BoxDecoration(
|
||||||
boxShadow: [
|
color: Colors.white,
|
||||||
BoxShadow(
|
borderRadius: BorderRadius.circular(16),
|
||||||
color: EnsupColors.text.withValues(alpha: 0.14),
|
boxShadow: [
|
||||||
blurRadius: 60,
|
BoxShadow(
|
||||||
offset: const Offset(0, 18),
|
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"),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
],
|
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()),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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