Page de connexion OK
Manque la logique de mot de passe oublié
This commit is contained in:
		
							
								
								
									
										21
									
								
								em2rp/lib/views/widgets/auth/forgot_password_button.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								em2rp/lib/views/widgets/auth/forgot_password_button.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| class ForgotPasswordButtonWidget extends StatelessWidget { | ||||
|   final VoidCallback onPressed; | ||||
|  | ||||
|   const ForgotPasswordButtonWidget({super.key, required this.onPressed}); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Align( | ||||
|       alignment: Alignment.centerRight, | ||||
|       child: TextButton( | ||||
|         onPressed: onPressed, | ||||
|         child: const Text( | ||||
|           'Mot de passe oublié ?', | ||||
|           style: TextStyle(color: Colors.grey), | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
							
								
								
									
										29
									
								
								em2rp/lib/views/widgets/auth/login_button.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								em2rp/lib/views/widgets/auth/login_button.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| import 'package:em2rp/utils/colors.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| class LoginButtonWidget extends StatelessWidget { | ||||
|   final bool isLoading; | ||||
|   final VoidCallback onPressed; | ||||
|  | ||||
|   const LoginButtonWidget({ | ||||
|     super.key, | ||||
|     required this.isLoading, | ||||
|     required this.onPressed, | ||||
|   }); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return ElevatedButton( | ||||
|       onPressed: isLoading ? null : onPressed, | ||||
|       style: ElevatedButton.styleFrom( | ||||
|         padding: const EdgeInsets.symmetric(vertical: 15), | ||||
|         textStyle: const TextStyle(fontSize: 18), | ||||
|       ), | ||||
|       child: isLoading | ||||
|           ? const CircularProgressIndicator( | ||||
|               color: AppColors.blanc, | ||||
|             ) | ||||
|           : const Text('Se connecter'), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
							
								
								
									
										31
									
								
								em2rp/lib/views/widgets/auth/mail_textfield.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								em2rp/lib/views/widgets/auth/mail_textfield.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| import 'package:em2rp/utils/colors.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| class EmailTextFieldWidget extends StatelessWidget { | ||||
|   final TextEditingController emailController; | ||||
|   final bool highlightEmailField; | ||||
|  | ||||
|   const EmailTextFieldWidget({ | ||||
|     super.key, | ||||
|     required this.emailController, | ||||
|     required this.highlightEmailField, | ||||
|   }); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return TextField( | ||||
|       controller: emailController, | ||||
|       keyboardType: TextInputType.emailAddress, | ||||
|       decoration: InputDecoration( | ||||
|         labelText: 'Email', | ||||
|         border: OutlineInputBorder( | ||||
|           borderSide: highlightEmailField | ||||
|               ? const BorderSide(color: Colors.red) | ||||
|               : const BorderSide(), | ||||
|         ), | ||||
|         filled: true, | ||||
|         fillColor: AppColors.blanc, | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
							
								
								
									
										43
									
								
								em2rp/lib/views/widgets/auth/password_textfield.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								em2rp/lib/views/widgets/auth/password_textfield.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,43 @@ | ||||
| import 'package:em2rp/utils/colors.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:em2rp/utils/colors.dart'; | ||||
|  | ||||
| class PasswordTextFieldWidget extends StatelessWidget { | ||||
|   final TextEditingController passwordController; | ||||
|   final bool obscurePassword; | ||||
|   final bool highlightPasswordField; | ||||
|   final VoidCallback onTogglePasswordVisibility; | ||||
|  | ||||
|   const PasswordTextFieldWidget({ | ||||
|     super.key, | ||||
|     required this.passwordController, | ||||
|     required this.obscurePassword, | ||||
|     required this.highlightPasswordField, | ||||
|     required this.onTogglePasswordVisibility, | ||||
|   }); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return TextField( | ||||
|       controller: passwordController, | ||||
|       obscureText: obscurePassword, | ||||
|       decoration: InputDecoration( | ||||
|         labelText: 'Mot de passe', | ||||
|         border: OutlineInputBorder( | ||||
|           borderSide: highlightPasswordField | ||||
|               ? const BorderSide(color: Colors.red) | ||||
|               : const BorderSide(), | ||||
|         ), | ||||
|         filled: true, | ||||
|         fillColor: AppColors.blanc, | ||||
|         suffixIcon: IconButton( | ||||
|           icon: Icon( | ||||
|             obscurePassword ? Icons.visibility_off : Icons.visibility, | ||||
|             color: AppColors.gris, | ||||
|           ), | ||||
|           onPressed: onTogglePasswordVisibility, | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
							
								
								
									
										16
									
								
								em2rp/lib/views/widgets/auth/welcome_text.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								em2rp/lib/views/widgets/auth/welcome_text.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| import 'package:em2rp/utils/colors.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| class WelcomeTextWidget extends StatelessWidget { | ||||
|   const WelcomeTextWidget({super.key}); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Text( | ||||
|       'Bienvenue !', | ||||
|       textAlign: TextAlign.center, | ||||
|       style: TextStyle( | ||||
|           fontSize: 28, fontWeight: FontWeight.bold, color: AppColors.noir), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
							
								
								
									
										22
									
								
								em2rp/lib/views/widgets/error_message.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								em2rp/lib/views/widgets/error_message.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| class ErrorMessageWidget extends StatelessWidget { | ||||
|   final String errorMessage; | ||||
|  | ||||
|   const ErrorMessageWidget({super.key, required this.errorMessage}); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Visibility( | ||||
|       visible: errorMessage.isNotEmpty, | ||||
|       child: Padding( | ||||
|         padding: const EdgeInsets.only(top: 20.0), | ||||
|         child: Text( | ||||
|           errorMessage, | ||||
|           textAlign: TextAlign.center, | ||||
|           style: const TextStyle(color: Colors.red), | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
							
								
								
									
										23
									
								
								em2rp/lib/views/widgets/image/big_image_left.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								em2rp/lib/views/widgets/image/big_image_left.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| import 'package:em2rp/utils/colors.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| class ImageSectionWidget extends StatelessWidget { | ||||
|   const ImageSectionWidget({super.key}); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Container( | ||||
|       color: AppColors.gris.withOpacity(0.1), | ||||
|       child: ClipRRect( | ||||
|         borderRadius: BorderRadius.zero, | ||||
|         child: Image.asset( | ||||
|           'assets/images/tshirt-incrust.webp', | ||||
|           fit: BoxFit.cover, | ||||
|           height: double.infinity, | ||||
|           width: double.infinity, | ||||
|           alignment: Alignment.centerLeft, | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| } | ||||
							
								
								
									
										13
									
								
								em2rp/lib/views/widgets/image/em2_logo_n_sur_b.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								em2rp/lib/views/widgets/image/em2_logo_n_sur_b.dart
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| class LogoWidget extends StatelessWidget { | ||||
|   const LogoWidget({super.key}); | ||||
|  | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     return Image.asset( | ||||
|       'assets/EM2_NsurB.jpg', | ||||
|       height: 100, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user