Restructuration majeure du projet: migration de flutt vers app, ajout de l'API et mise à jour du site web
This commit is contained in:
167
app/lib/shared/app_theme.dart
Normal file
167
app/lib/shared/app_theme.dart
Normal file
@@ -0,0 +1,167 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppTheme {
|
||||
// Couleurs principales
|
||||
static const Color primaryColor = Color(0xFF4B77BE);
|
||||
static const Color secondaryColor = Color(0xFF2C3E50);
|
||||
static const Color accentColor = Color(0xFF3498DB);
|
||||
static const Color backgroundColor = Color(0xFFF5F7FA);
|
||||
static const Color cardColor = Colors.white;
|
||||
|
||||
// Couleurs de texte
|
||||
static const Color textPrimaryColor = Color(0xFF2C3E50);
|
||||
static const Color textSecondaryColor = Color(0xFF7F8C8D);
|
||||
static const Color textLightColor = Color(0xFFBDC3C7);
|
||||
|
||||
// Couleurs des boutons
|
||||
static const Color buttonPrimaryColor = Color(0xFF4B77BE);
|
||||
static const Color buttonSecondaryColor = Color(0xFF95A5A6);
|
||||
static const Color buttonSuccessColor = Color(0xFF2ECC71);
|
||||
static const Color buttonDangerColor = Color(0xFFE74C3C);
|
||||
static const Color buttonWarningColor = Color(0xFFF1C40F);
|
||||
|
||||
// Couleurs des charts
|
||||
static const List<Color> chartColors = [
|
||||
Color(0xFF4B77BE),
|
||||
Color(0xFF2ECC71),
|
||||
Color(0xFFE74C3C),
|
||||
Color(0xFFF1C40F),
|
||||
Color(0xFF9B59B6),
|
||||
Color(0xFF1ABC9C),
|
||||
Color(0xFFE67E22),
|
||||
];
|
||||
|
||||
// Ombres
|
||||
static List<BoxShadow> cardShadow = [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 3),
|
||||
),
|
||||
];
|
||||
|
||||
static List<BoxShadow> buttonShadow = [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 5,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
];
|
||||
|
||||
// Rayons des bordures
|
||||
static const double borderRadiusSmall = 4.0;
|
||||
static const double borderRadiusMedium = 8.0;
|
||||
static const double borderRadiusLarge = 12.0;
|
||||
|
||||
// Espacement
|
||||
static const double spacingXS = 4.0;
|
||||
static const double spacingS = 8.0;
|
||||
static const double spacingM = 16.0;
|
||||
static const double spacingL = 24.0;
|
||||
static const double spacingXL = 32.0;
|
||||
static const double spacingXXL = 48.0;
|
||||
|
||||
// Thème light
|
||||
static ThemeData lightTheme = ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: ColorScheme.light(
|
||||
primary: primaryColor,
|
||||
secondary: secondaryColor,
|
||||
background: backgroundColor,
|
||||
surface: cardColor,
|
||||
),
|
||||
scaffoldBackgroundColor: backgroundColor,
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
),
|
||||
cardTheme: CardTheme(
|
||||
color: cardColor,
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadiusMedium),
|
||||
),
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: buttonPrimaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 2,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: spacingL,
|
||||
vertical: spacingM,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadiusMedium),
|
||||
),
|
||||
),
|
||||
),
|
||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: primaryColor,
|
||||
side: const BorderSide(color: primaryColor),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: spacingL,
|
||||
vertical: spacingM,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadiusMedium),
|
||||
),
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: primaryColor,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: spacingM,
|
||||
vertical: spacingS,
|
||||
),
|
||||
),
|
||||
),
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadiusMedium),
|
||||
borderSide: BorderSide(color: textLightColor),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadiusMedium),
|
||||
borderSide: BorderSide(color: textLightColor),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadiusMedium),
|
||||
borderSide: BorderSide(color: primaryColor),
|
||||
),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: spacingM,
|
||||
vertical: spacingM,
|
||||
),
|
||||
),
|
||||
textTheme: const TextTheme(
|
||||
displayLarge: TextStyle(color: textPrimaryColor),
|
||||
displayMedium: TextStyle(color: textPrimaryColor),
|
||||
displaySmall: TextStyle(color: textPrimaryColor),
|
||||
headlineLarge: TextStyle(color: textPrimaryColor),
|
||||
headlineMedium: TextStyle(color: textPrimaryColor),
|
||||
headlineSmall: TextStyle(color: textPrimaryColor),
|
||||
titleLarge: TextStyle(color: textPrimaryColor),
|
||||
titleMedium: TextStyle(color: textPrimaryColor),
|
||||
titleSmall: TextStyle(color: textPrimaryColor),
|
||||
bodyLarge: TextStyle(color: textPrimaryColor),
|
||||
bodyMedium: TextStyle(color: textPrimaryColor),
|
||||
bodySmall: TextStyle(color: textSecondaryColor),
|
||||
labelLarge: TextStyle(color: textPrimaryColor),
|
||||
labelMedium: TextStyle(color: textSecondaryColor),
|
||||
labelSmall: TextStyle(color: textSecondaryColor),
|
||||
),
|
||||
dividerTheme: const DividerThemeData(
|
||||
color: Color(0xFFECF0F1),
|
||||
thickness: 1,
|
||||
space: spacingM,
|
||||
),
|
||||
);
|
||||
}
|
||||
60
app/lib/shared/widgets/admin_background.dart
Normal file
60
app/lib/shared/widgets/admin_background.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:math' as math;
|
||||
|
||||
/// Widget pour créer un fond dégradé avec des petits points blancs
|
||||
/// Utilisé pour les pages d'administration
|
||||
class AdminBackground extends StatelessWidget {
|
||||
final Widget child;
|
||||
|
||||
const AdminBackground({
|
||||
Key? key,
|
||||
required this.child,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
// Fond dégradé avec petits points blancs
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Colors.white, Colors.red.shade300],
|
||||
),
|
||||
),
|
||||
child: CustomPaint(
|
||||
painter: DotsPainter(),
|
||||
child: Container(width: double.infinity, height: double.infinity),
|
||||
),
|
||||
),
|
||||
// Contenu de la page
|
||||
child,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Class pour dessiner les petits points blancs sur le fond
|
||||
class DotsPainter extends CustomPainter {
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final paint = Paint()
|
||||
..color = Colors.white.withOpacity(0.5)
|
||||
..style = PaintingStyle.fill;
|
||||
|
||||
final random = math.Random(42); // Seed fixe pour consistance
|
||||
final numberOfDots = (size.width * size.height) ~/ 1500;
|
||||
|
||||
for (int i = 0; i < numberOfDots; i++) {
|
||||
final x = random.nextDouble() * size.width;
|
||||
final y = random.nextDouble() * size.height;
|
||||
final radius = 1.0 + random.nextDouble() * 2.0;
|
||||
canvas.drawCircle(Offset(x, y), radius, paint);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
|
||||
}
|
||||
Reference in New Issue
Block a user