-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from B3-3iL-DLW/ui/create-login-page
UI/create login page related to #17
- Loading branch information
Showing
16 changed files
with
307 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
///This file is automatically generated. DO NOT EDIT, all your changes would be lost. | ||
class Assets { | ||
Assets._(); | ||
|
||
static const String images3ilLogo = 'assets/images/3il-logo.jpg'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:app_student/login/widgets/form/form_login.dart'; | ||
import 'package:app_student/login/widgets/header/header_text.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../widgets/header/header_logo.dart'; | ||
|
||
class LoginPage extends StatelessWidget { | ||
const LoginPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Scaffold( | ||
body: Column( | ||
children: [ | ||
HeaderLogo(), | ||
HeaderText("Bonjour :)"), | ||
Expanded(child: FormLogin()), | ||
], | ||
), | ||
); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
frontend/app_student/lib/login/widgets/form/button_submit.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class SubmitButton extends StatelessWidget { | ||
const SubmitButton({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 25.0, top: 80.0, right: 25.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
SizedBox( | ||
width: double.infinity, | ||
height: 50.0, | ||
child: ElevatedButton( | ||
style: ButtonStyle( | ||
textStyle: MaterialStateProperty.all<TextStyle>( | ||
const TextStyle( | ||
fontSize: 16.0, | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
backgroundColor: MaterialStateProperty.all<Color>( | ||
Theme.of(context).focusColor), | ||
foregroundColor: MaterialStateProperty.all<Color>(Colors.white), | ||
shape: MaterialStateProperty.all<RoundedRectangleBorder>( | ||
RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(3.0), | ||
), | ||
), | ||
), | ||
onPressed: () {}, | ||
child: const Text('Connexion'), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
frontend/app_student/lib/login/widgets/form/form_login.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'button_submit.dart'; | ||
import 'inputs/input_birthdate.dart'; | ||
import 'inputs/input_ine.dart'; | ||
import 'inputs/input_prenom.dart'; | ||
|
||
class FormLogin extends StatelessWidget { | ||
const FormLogin({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Scaffold( | ||
body: Column( | ||
children: [ | ||
INETextField(), | ||
BirthDateField(), | ||
FirstnameTextField(), | ||
SubmitButton() | ||
], | ||
), | ||
); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
frontend/app_student/lib/login/widgets/form/inputs/input_birthdate.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class BirthDateField extends StatefulWidget { | ||
const BirthDateField({super.key}); | ||
|
||
@override | ||
BirthDateFieldState createState() => BirthDateFieldState(); | ||
} | ||
|
||
class BirthDateFieldState extends State<BirthDateField> { | ||
DateTime _selectedDate = DateTime.now(); | ||
|
||
Future<void> _selectDate(BuildContext context) async { | ||
final DateTime? picked = await showDatePicker( | ||
context: context, | ||
initialDate: _selectedDate, | ||
firstDate: DateTime(1900), | ||
lastDate: DateTime.now(), | ||
); | ||
if (picked != null && picked != _selectedDate) { | ||
setState(() { | ||
_selectedDate = picked; | ||
}); | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 25.0, top: 30.0, right: 25.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'Date de naissance', | ||
style: TextStyle( | ||
fontSize: 12.0, | ||
color: Colors.grey[600], | ||
), | ||
), | ||
const SizedBox(height: 10.0), | ||
TextFormField( | ||
readOnly: true, | ||
decoration: InputDecoration( | ||
hintText: _selectedDate.toLocal().toString().split(' ')[0], | ||
contentPadding: | ||
const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0), | ||
border: OutlineInputBorder( | ||
borderSide: const BorderSide(color: Colors.grey), | ||
borderRadius: BorderRadius.circular(3.0), | ||
), | ||
focusedBorder: OutlineInputBorder( | ||
borderSide: BorderSide(color: Theme.of(context).focusColor), | ||
borderRadius: BorderRadius.circular(3.0), | ||
), | ||
), | ||
onTap: () => _selectDate(context), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
frontend/app_student/lib/login/widgets/form/inputs/input_ine.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class INETextField extends StatelessWidget { | ||
const INETextField({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.only( | ||
left: 25.0, | ||
top: 10.0, | ||
right: 25.0), // Ajout d'un padding à gauche, en haut et à droite | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'INE', | ||
style: TextStyle( | ||
fontSize: 12.0, | ||
color: Colors.grey[600], | ||
), | ||
), | ||
const SizedBox(height: 10.0), | ||
TextFormField( | ||
decoration: InputDecoration( | ||
hintText: 'Numéro INE', | ||
contentPadding: | ||
const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0), | ||
border: OutlineInputBorder( | ||
borderSide: const BorderSide(color: Colors.grey), | ||
borderRadius: BorderRadius.circular(3.0), | ||
), | ||
focusedBorder: OutlineInputBorder( | ||
borderSide: BorderSide(color: Theme.of(context).focusColor), | ||
borderRadius: BorderRadius.circular(3.0), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
frontend/app_student/lib/login/widgets/form/inputs/input_prenom.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class FirstnameTextField extends StatelessWidget { | ||
const FirstnameTextField({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 25.0, top: 30.0, right: 25.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
'Prénom', | ||
style: TextStyle( | ||
fontSize: 12.0, | ||
color: Colors.grey[600], | ||
), | ||
), | ||
const SizedBox(height: 10.0), | ||
TextFormField( | ||
style: TextStyle( | ||
color: Colors.grey[600], | ||
), | ||
decoration: InputDecoration( | ||
hintText: 'Entrez votre prénom ici', | ||
contentPadding: | ||
const EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0), | ||
border: OutlineInputBorder( | ||
borderSide: BorderSide(color: Colors.grey), | ||
borderRadius: BorderRadius.circular(3.0), | ||
), | ||
focusedBorder: OutlineInputBorder( | ||
borderSide: BorderSide(color: Theme.of(context).focusColor), | ||
borderRadius: BorderRadius.circular(3.0), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
frontend/app_student/lib/login/widgets/header/header_logo.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class HeaderLogo extends StatelessWidget { | ||
const HeaderLogo({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
height: 210.0, // Hauteur du Container | ||
color: const Color(0xFF005067), | ||
child: Center( | ||
child: SizedBox( | ||
width: 200.0, // Largeur de l'image | ||
height: 200.0, // Hauteur de l'image | ||
child: Image.asset('images/3il-logo.jpg'), | ||
), | ||
), | ||
); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
frontend/app_student/lib/login/widgets/header/header_text.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class HeaderText extends StatelessWidget { | ||
final String content; | ||
|
||
const HeaderText(this.content, {super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: const EdgeInsets.only( | ||
top: 35.0, | ||
left: 25.0, | ||
bottom: 40), // Ajout d'un espacement à gauche de 10px | ||
child: Align( | ||
alignment: Alignment.centerLeft, | ||
child: Text( | ||
content, | ||
style: const TextStyle( | ||
fontSize: 34.0, | ||
fontFamily: 'Arial', | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.