First commit
This commit is contained in:
59
lib/main.dart
Normal file
59
lib/main.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:travel_mate/pages/resetpswd.dart';
|
||||
import 'package:travel_mate/pages/signup.dart';
|
||||
import 'pages/login.dart';
|
||||
import 'pages/home.dart';
|
||||
import 'providers/theme_provider.dart';
|
||||
|
||||
void main() {
|
||||
runApp(
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => ThemeProvider(),
|
||||
child: const MyApp(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<ThemeProvider>(
|
||||
builder: (context, themeProvider, child) {
|
||||
return MaterialApp(
|
||||
title: 'Travel Mate',
|
||||
themeMode: themeProvider.themeMode,
|
||||
|
||||
// Thème clair
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color.fromARGB(255, 180, 180, 180),
|
||||
brightness: Brightness.light,
|
||||
),
|
||||
useMaterial3: true,
|
||||
),
|
||||
|
||||
// Thème sombre
|
||||
darkTheme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color.fromARGB(255, 43, 43, 43),
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
useMaterial3: true,
|
||||
),
|
||||
|
||||
initialRoute: '/login',
|
||||
routes: {
|
||||
'/login': (context) => const LoginPage(),
|
||||
'/signup': (context) => const SignUpPage(),
|
||||
'/home': (context) => const HomePage(),
|
||||
'/forgot': (context) => const ForgotPasswordPage(),
|
||||
},
|
||||
debugShowCheckedModeBanner: false,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user