Ajout de la page de connexion
This commit is contained in:
@ -1,28 +1,61 @@
|
||||
import 'package:em2rp/views/login_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'firebase_options.dart';
|
||||
import 'utils/colors.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding
|
||||
.ensureInitialized(); // Assure que Flutter est initialisé
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await Firebase.initializeApp(
|
||||
options:
|
||||
DefaultFirebaseOptions.currentPlatform, // Utilise firebase_options.dart
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
runApp(const MainApp());
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
class MainApp extends StatelessWidget {
|
||||
const MainApp({super.key});
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const MaterialApp(
|
||||
home: Scaffold(
|
||||
body: Center(
|
||||
child: Text('Hello World!'),
|
||||
return MaterialApp(
|
||||
title: 'EM2 ERP',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.red,
|
||||
primaryColor: AppColors.noir,
|
||||
colorScheme:
|
||||
ColorScheme.fromSwatch().copyWith(secondary: AppColors.rouge),
|
||||
textTheme: const TextTheme(
|
||||
bodyMedium: TextStyle(color: AppColors.noir),
|
||||
),
|
||||
// Personnalisation de l'InputDecorationTheme pour les text fields
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
focusedBorder: OutlineInputBorder(
|
||||
// Bordure lorsqu'il est focus
|
||||
borderSide:
|
||||
BorderSide(color: AppColors.rouge), // Couleur rouge quand focus
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
// Bordure par défaut (non focus)
|
||||
borderSide:
|
||||
BorderSide(color: AppColors.gris), // Couleur grise par défaut
|
||||
),
|
||||
labelStyle: TextStyle(color: AppColors.noir), // Couleur du label
|
||||
hintStyle: TextStyle(color: AppColors.gris), // Couleur du hint text
|
||||
// Tu peux personnaliser d'autres propriétés ici :
|
||||
// fillColor, filled, iconColor, prefixStyle, suffixStyle, etc.
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor:
|
||||
AppColors.blanc, // Couleur du texte du bouton (ici blanc)
|
||||
backgroundColor: AppColors
|
||||
.noir, // Couleur de fond du bouton (si tu veux aussi changer le fond)
|
||||
// Autres styles possibles pour les boutons :
|
||||
// textStyle, padding, shape, elevation, etc.
|
||||
),
|
||||
),
|
||||
),
|
||||
home: const LoginPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user