Initial commit: Configuration du projet P'titsPas

This commit is contained in:
Julien Martin
2025-04-28 18:17:56 +02:00
commit d5015b9c42
29 changed files with 465 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:google_fonts/google_fonts.dart';
import 'theme/app_theme.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'P\'titsPas',
theme: AppTheme.lightTheme,
routerConfig: GoRouter(
initialLocation: '/',
routes: [
GoRoute(
path: '/',
builder: (context, state) => const HomePage(),
),
],
),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('P\'titsPas'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/logo.png',
width: 200,
height: 200,
),
const SizedBox(height: 24),
Text(
'Bienvenue sur P\'titsPas',
style: Theme.of(context).textTheme.displayMedium,
),
const SizedBox(height: 16),
Text(
'La plateforme de gestion de la garde d\'enfants',
style: Theme.of(context).textTheme.bodyLarge,
),
],
),
),
);
}
}
+74
View File
@@ -0,0 +1,74 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class AppTheme {
static const Color primaryColor = Color(0xFF2B6CB0);
static const Color secondaryColor = Color(0xFFF7FAFC);
static const Color backgroundColor = Colors.white;
static const Color textColor = Color(0xFF2D3748);
static ThemeData get lightTheme {
return ThemeData(
useMaterial3: true,
colorScheme: ColorScheme.light(
primary: primaryColor,
secondary: secondaryColor,
background: backgroundColor,
),
textTheme: TextTheme(
displayLarge: GoogleFonts.comfortaa(
fontSize: 32,
fontWeight: FontWeight.bold,
color: textColor,
),
displayMedium: GoogleFonts.comfortaa(
fontSize: 24,
fontWeight: FontWeight.bold,
color: textColor,
),
bodyLarge: GoogleFonts.roboto(
fontSize: 16,
color: textColor,
),
bodyMedium: GoogleFonts.roboto(
fontSize: 14,
color: textColor,
),
),
appBarTheme: AppBarTheme(
backgroundColor: primaryColor,
foregroundColor: Colors.white,
elevation: 0,
titleTextStyle: GoogleFonts.comfortaa(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: primaryColor,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
inputDecorationTheme: InputDecorationTheme(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: primaryColor.withOpacity(0.5)),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: primaryColor.withOpacity(0.3)),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: BorderSide(color: primaryColor),
),
),
);
}
}