|
|
@ -1,9 +1,11 @@
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_signin_button/button_list.dart';
|
|
|
|
import 'package:flutter_signin_button/button_list.dart';
|
|
|
|
import 'package:flutter_signin_button/button_view.dart';
|
|
|
|
import 'package:flutter_signin_button/button_view.dart';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
|
|
|
|
import 'package:justmusic/main.dart';
|
|
|
|
import 'package:justmusic/values/constants.dart';
|
|
|
|
import 'package:justmusic/values/constants.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../components/login_button.dart';
|
|
|
|
import '../components/login_button.dart';
|
|
|
@ -18,6 +20,32 @@ class LoginScreen extends StatefulWidget {
|
|
|
|
class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
bool passenable = true;
|
|
|
|
bool passenable = true;
|
|
|
|
final _formKey = GlobalKey<FormState>();
|
|
|
|
final _formKey = GlobalKey<FormState>();
|
|
|
|
|
|
|
|
final _userMailTextField = TextEditingController();
|
|
|
|
|
|
|
|
final _passwordTextField = TextEditingController();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleLogin() async {
|
|
|
|
|
|
|
|
if (_formKey.currentState!.validate()) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
await MyApp.userViewModel
|
|
|
|
|
|
|
|
.login(_userMailTextField.text, _passwordTextField.text);
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, '/explanation');
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
print(e);
|
|
|
|
|
|
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
|
|
|
|
|
|
SnackBar(
|
|
|
|
|
|
|
|
content: Text(
|
|
|
|
|
|
|
|
e.toString(),
|
|
|
|
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
|
|
|
fontSize: 20.h),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
backgroundColor: Colors.red,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
@ -26,10 +54,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
child: Scaffold(
|
|
|
|
child: Scaffold(
|
|
|
|
resizeToAvoidBottomInset: false,
|
|
|
|
resizeToAvoidBottomInset: false,
|
|
|
|
backgroundColor: bgColor,
|
|
|
|
backgroundColor: bgColor,
|
|
|
|
body: LayoutBuilder(
|
|
|
|
body: Align(
|
|
|
|
builder: (context, constraints) {
|
|
|
|
|
|
|
|
if (constraints.maxHeight >= 740) {
|
|
|
|
|
|
|
|
return Align(
|
|
|
|
|
|
|
|
child: SizedBox(
|
|
|
|
child: SizedBox(
|
|
|
|
height: double.infinity,
|
|
|
|
height: double.infinity,
|
|
|
|
width: 600,
|
|
|
|
width: 600,
|
|
|
@ -38,8 +63,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(left: 40, right: 40),
|
|
|
|
EdgeInsets.only(left: 40, right: 40),
|
|
|
|
|
|
|
|
child: Form(
|
|
|
|
child: Form(
|
|
|
|
key: _formKey,
|
|
|
|
key: _formKey,
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
@ -49,21 +73,18 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
Flexible(
|
|
|
|
Flexible(
|
|
|
|
flex: 5,
|
|
|
|
flex: 5,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(bottom: 60),
|
|
|
|
EdgeInsets.only(bottom: 60),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.end,
|
|
|
|
MainAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
"Te revoilà!",
|
|
|
|
"Te revoilà!",
|
|
|
|
style: GoogleFonts
|
|
|
|
style:
|
|
|
|
.plusJakartaSans(
|
|
|
|
GoogleFonts.plusJakartaSans(
|
|
|
|
color:
|
|
|
|
color: Colors.white,
|
|
|
|
Colors.white,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
fontWeight:
|
|
|
|
FontWeight
|
|
|
|
FontWeight.w600,
|
|
|
|
.w600,
|
|
|
|
|
|
|
|
fontSize: 38.h),
|
|
|
|
fontSize: 38.h),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
@ -75,14 +96,11 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
"Bon retour parmis nous tu nous as manqué!",
|
|
|
|
"Bon retour parmis nous tu nous as manqué!",
|
|
|
|
style: GoogleFonts
|
|
|
|
style: GoogleFonts
|
|
|
|
.plusJakartaSans(
|
|
|
|
.plusJakartaSans(
|
|
|
|
color: Colors
|
|
|
|
color: Colors.white,
|
|
|
|
.white,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
fontWeight:
|
|
|
|
FontWeight
|
|
|
|
FontWeight.w400,
|
|
|
|
.w400,
|
|
|
|
|
|
|
|
fontSize: 20.h),
|
|
|
|
fontSize: 20.h),
|
|
|
|
textAlign:
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
TextAlign.center,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -96,41 +114,36 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
CrossAxisAlignment.end,
|
|
|
|
CrossAxisAlignment.end,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
TextFormField(
|
|
|
|
TextFormField(
|
|
|
|
|
|
|
|
controller: _userMailTextField,
|
|
|
|
keyboardAppearance:
|
|
|
|
keyboardAppearance:
|
|
|
|
Brightness.dark,
|
|
|
|
Brightness.dark,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
if (value == null ||
|
|
|
|
if (value == null ||
|
|
|
|
value.isEmpty) {
|
|
|
|
value.isEmpty) {
|
|
|
|
return 'TODO';
|
|
|
|
return 'entrez un email valide';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cursorColor: primaryColor,
|
|
|
|
cursorColor: primaryColor,
|
|
|
|
keyboardType:
|
|
|
|
keyboardType:
|
|
|
|
TextInputType
|
|
|
|
TextInputType.emailAddress,
|
|
|
|
.emailAddress,
|
|
|
|
style:
|
|
|
|
style: GoogleFonts
|
|
|
|
GoogleFonts.plusJakartaSans(
|
|
|
|
.plusJakartaSans(
|
|
|
|
color: primaryColor),
|
|
|
|
color:
|
|
|
|
|
|
|
|
primaryColor),
|
|
|
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
width: 1,
|
|
|
|
width: 1,
|
|
|
|
color:
|
|
|
|
color:
|
|
|
|
strokeTextField),
|
|
|
|
strokeTextField),
|
|
|
|
borderRadius:
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
BorderRadius.all(
|
|
|
|
Radius.circular(10))),
|
|
|
|
Radius.circular(
|
|
|
|
|
|
|
|
10))),
|
|
|
|
|
|
|
|
contentPadding:
|
|
|
|
contentPadding:
|
|
|
|
EdgeInsets.only(
|
|
|
|
EdgeInsets.only(
|
|
|
|
top: 0,
|
|
|
|
top: 0,
|
|
|
|
bottom: 0,
|
|
|
|
bottom: 0,
|
|
|
|
left:
|
|
|
|
left: defaultPadding),
|
|
|
|
defaultPadding),
|
|
|
|
fillColor: bgTextField,
|
|
|
|
fillColor:
|
|
|
|
|
|
|
|
bgTextField,
|
|
|
|
|
|
|
|
filled: true,
|
|
|
|
filled: true,
|
|
|
|
focusColor: Color.fromRGBO(
|
|
|
|
focusColor: Color.fromRGBO(
|
|
|
|
255, 255, 255, 0.30),
|
|
|
|
255, 255, 255, 0.30),
|
|
|
@ -139,319 +152,36 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
width: 1,
|
|
|
|
width: 1,
|
|
|
|
color:
|
|
|
|
color:
|
|
|
|
strokeTextField),
|
|
|
|
strokeTextField),
|
|
|
|
borderRadius:
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
BorderRadius.all(Radius.circular(10))),
|
|
|
|
Radius.circular(10))),
|
|
|
|
hintText: 'Email',
|
|
|
|
hintText: 'Email',
|
|
|
|
hintStyle: GoogleFonts.plusJakartaSans(color: strokeTextField)),
|
|
|
|
hintStyle:
|
|
|
|
|
|
|
|
GoogleFonts.plusJakartaSans(color: strokeTextField)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 18,
|
|
|
|
height: 18,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TextFormField(
|
|
|
|
TextFormField(
|
|
|
|
|
|
|
|
controller: _passwordTextField,
|
|
|
|
keyboardAppearance:
|
|
|
|
keyboardAppearance:
|
|
|
|
Brightness.dark,
|
|
|
|
Brightness.dark,
|
|
|
|
obscureText: passenable,
|
|
|
|
obscureText: passenable,
|
|
|
|
validator: (value) {
|
|
|
|
validator: (value) {
|
|
|
|
if (value == null ||
|
|
|
|
if (value == null ||
|
|
|
|
value.isEmpty) {
|
|
|
|
value.isEmpty) {
|
|
|
|
return 'TODO';
|
|
|
|
return 'entrez un mot de passe valide';
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
cursorColor: primaryColor,
|
|
|
|
|
|
|
|
keyboardType:
|
|
|
|
|
|
|
|
TextInputType
|
|
|
|
|
|
|
|
.emailAddress,
|
|
|
|
|
|
|
|
style: GoogleFonts
|
|
|
|
|
|
|
|
.plusJakartaSans(
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
primaryColor),
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
InputDecoration(
|
|
|
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
|
|
|
borderSide: BorderSide(
|
|
|
|
|
|
|
|
width: 1,
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
strokeTextField),
|
|
|
|
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius
|
|
|
|
|
|
|
|
.all(Radius
|
|
|
|
|
|
|
|
.circular(
|
|
|
|
|
|
|
|
10))),
|
|
|
|
|
|
|
|
contentPadding:
|
|
|
|
|
|
|
|
EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 0,
|
|
|
|
|
|
|
|
bottom: 0,
|
|
|
|
|
|
|
|
left:
|
|
|
|
|
|
|
|
defaultPadding),
|
|
|
|
|
|
|
|
fillColor: bgTextField,
|
|
|
|
|
|
|
|
filled: true,
|
|
|
|
|
|
|
|
focusColor:
|
|
|
|
|
|
|
|
Color.fromRGBO(255,
|
|
|
|
|
|
|
|
255, 255, 0.30),
|
|
|
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
|
|
|
borderSide: BorderSide(
|
|
|
|
|
|
|
|
width: 1,
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
strokeTextField),
|
|
|
|
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius
|
|
|
|
|
|
|
|
.all(Radius
|
|
|
|
|
|
|
|
.circular(
|
|
|
|
|
|
|
|
10))),
|
|
|
|
|
|
|
|
hintText:
|
|
|
|
|
|
|
|
'Mot de passe',
|
|
|
|
|
|
|
|
hintStyle: GoogleFonts
|
|
|
|
|
|
|
|
.plusJakartaSans(
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
strokeTextField),
|
|
|
|
|
|
|
|
suffixIcon: Container(
|
|
|
|
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.only(
|
|
|
|
|
|
|
|
right: 10),
|
|
|
|
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.all(
|
|
|
|
|
|
|
|
5),
|
|
|
|
|
|
|
|
height: 3,
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
if (passenable) {
|
|
|
|
|
|
|
|
passenable =
|
|
|
|
|
|
|
|
false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
passenable =
|
|
|
|
|
|
|
|
true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}, // Image tapped
|
|
|
|
|
|
|
|
splashColor: Colors
|
|
|
|
|
|
|
|
.white10, // Splash color over image
|
|
|
|
|
|
|
|
child: Image(
|
|
|
|
|
|
|
|
image: passenable
|
|
|
|
|
|
|
|
? AssetImage(
|
|
|
|
|
|
|
|
"assets/images/show_icon.png")
|
|
|
|
|
|
|
|
: AssetImage(
|
|
|
|
|
|
|
|
"assets/images/hide_icon.png"),
|
|
|
|
|
|
|
|
height: 2,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 10),
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
"Mot de passe oublié?",
|
|
|
|
|
|
|
|
style: GoogleFonts
|
|
|
|
|
|
|
|
.plusJakartaSans(
|
|
|
|
|
|
|
|
color: Colors
|
|
|
|
|
|
|
|
.white),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: defaultPadding,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 600,
|
|
|
|
|
|
|
|
child: LoginButton()),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 3,
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.only(top: 20),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
|
|
|
.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
ConstrainedBox(
|
|
|
|
|
|
|
|
constraints:
|
|
|
|
|
|
|
|
BoxConstraints(
|
|
|
|
|
|
|
|
maxWidth: 600),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
|
|
|
.spaceEvenly,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
color: Color(
|
|
|
|
|
|
|
|
0xFF3D3D3D),
|
|
|
|
|
|
|
|
height: 1,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets
|
|
|
|
|
|
|
|
.only(
|
|
|
|
|
|
|
|
left:
|
|
|
|
|
|
|
|
defaultPadding,
|
|
|
|
|
|
|
|
right:
|
|
|
|
|
|
|
|
defaultPadding),
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
'Ou',
|
|
|
|
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
|
|
|
|
color: Colors
|
|
|
|
|
|
|
|
.white,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child:
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: 1,
|
|
|
|
|
|
|
|
color: Color(
|
|
|
|
|
|
|
|
0xFF3D3D3D),
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height:
|
|
|
|
|
|
|
|
defaultPadding),
|
|
|
|
|
|
|
|
SignInButton(
|
|
|
|
|
|
|
|
Buttons.Google,
|
|
|
|
|
|
|
|
text:
|
|
|
|
|
|
|
|
"Login with Google",
|
|
|
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 20),
|
|
|
|
|
|
|
|
child: RichText(
|
|
|
|
|
|
|
|
textAlign:
|
|
|
|
|
|
|
|
TextAlign.center,
|
|
|
|
|
|
|
|
text: TextSpan(
|
|
|
|
|
|
|
|
text:
|
|
|
|
|
|
|
|
'Pas encore inscrit?',
|
|
|
|
|
|
|
|
style: GoogleFonts
|
|
|
|
|
|
|
|
.plusJakartaSans(
|
|
|
|
|
|
|
|
color: Colors
|
|
|
|
|
|
|
|
.white,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w400,
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
13),
|
|
|
|
|
|
|
|
children: <
|
|
|
|
|
|
|
|
TextSpan>[
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
|
|
|
|
text:
|
|
|
|
|
|
|
|
" S’inscire",
|
|
|
|
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
|
|
|
|
fontSize:
|
|
|
|
|
|
|
|
13,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w400,
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
primaryColor)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
))))
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return Align(
|
|
|
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
|
|
|
width: 600,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 40, right: 40),
|
|
|
|
|
|
|
|
child: Form(
|
|
|
|
|
|
|
|
key: _formKey,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Flexible(
|
|
|
|
|
|
|
|
flex: 2,
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.only(bottom: 30),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.end,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
"Te revoilà!",
|
|
|
|
|
|
|
|
style: GoogleFonts
|
|
|
|
|
|
|
|
.plusJakartaSans(
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
Colors.white,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w600,
|
|
|
|
|
|
|
|
fontSize: 38.h),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
width: 230,
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
"Bon retour parmis nous tu nous as manqué!",
|
|
|
|
|
|
|
|
style: GoogleFonts
|
|
|
|
|
|
|
|
.plusJakartaSans(
|
|
|
|
|
|
|
|
color: Colors
|
|
|
|
|
|
|
|
.white,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight
|
|
|
|
|
|
|
|
.w400,
|
|
|
|
|
|
|
|
fontSize: 20.h),
|
|
|
|
|
|
|
|
textAlign:
|
|
|
|
|
|
|
|
TextAlign.center,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 4,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.end,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
TextFormField(
|
|
|
|
|
|
|
|
keyboardAppearance:
|
|
|
|
|
|
|
|
Brightness.dark,
|
|
|
|
|
|
|
|
validator: (value) {
|
|
|
|
|
|
|
|
if (value == null ||
|
|
|
|
|
|
|
|
value.isEmpty) {
|
|
|
|
|
|
|
|
return 'TODO';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
cursorColor: primaryColor,
|
|
|
|
cursorColor: primaryColor,
|
|
|
|
keyboardType:
|
|
|
|
keyboardType:
|
|
|
|
TextInputType
|
|
|
|
TextInputType.emailAddress,
|
|
|
|
.emailAddress,
|
|
|
|
style:
|
|
|
|
style: GoogleFonts
|
|
|
|
GoogleFonts.plusJakartaSans(
|
|
|
|
.plusJakartaSans(
|
|
|
|
color: primaryColor),
|
|
|
|
color:
|
|
|
|
|
|
|
|
primaryColor),
|
|
|
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
focusedBorder:
|
|
|
|
|
|
|
|
OutlineInputBorder(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
width: 1,
|
|
|
|
width: 1,
|
|
|
|
color:
|
|
|
|
color:
|
|
|
@ -460,110 +190,47 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
BorderRadius.all(
|
|
|
|
BorderRadius.all(
|
|
|
|
Radius.circular(
|
|
|
|
Radius.circular(
|
|
|
|
10))),
|
|
|
|
10))),
|
|
|
|
contentPadding:
|
|
|
|
contentPadding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 0,
|
|
|
|
top: 0,
|
|
|
|
bottom: 0,
|
|
|
|
bottom: 0,
|
|
|
|
left:
|
|
|
|
left: defaultPadding),
|
|
|
|
defaultPadding),
|
|
|
|
fillColor: bgTextField,
|
|
|
|
fillColor:
|
|
|
|
|
|
|
|
bgTextField,
|
|
|
|
|
|
|
|
filled: true,
|
|
|
|
filled: true,
|
|
|
|
focusColor: Color.fromRGBO(
|
|
|
|
focusColor: Color.fromRGBO(
|
|
|
|
255, 255, 255, 0.30),
|
|
|
|
255, 255, 255, 0.30),
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
enabledBorder:
|
|
|
|
borderSide: BorderSide(
|
|
|
|
OutlineInputBorder(
|
|
|
|
width: 1,
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
strokeTextField),
|
|
|
|
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius.all(Radius.circular(10))),
|
|
|
|
|
|
|
|
hintText: 'Email',
|
|
|
|
|
|
|
|
hintStyle: GoogleFonts.plusJakartaSans(color: strokeTextField, fontSize: 15)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 18,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
TextFormField(
|
|
|
|
|
|
|
|
keyboardAppearance:
|
|
|
|
|
|
|
|
Brightness.dark,
|
|
|
|
|
|
|
|
obscureText: passenable,
|
|
|
|
|
|
|
|
validator: (value) {
|
|
|
|
|
|
|
|
if (value == null ||
|
|
|
|
|
|
|
|
value.isEmpty) {
|
|
|
|
|
|
|
|
return 'TODO';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
cursorColor: primaryColor,
|
|
|
|
|
|
|
|
keyboardType:
|
|
|
|
|
|
|
|
TextInputType
|
|
|
|
|
|
|
|
.emailAddress,
|
|
|
|
|
|
|
|
style: GoogleFonts
|
|
|
|
|
|
|
|
.plusJakartaSans(
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
primaryColor),
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
InputDecoration(
|
|
|
|
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
|
|
|
|
borderSide: BorderSide(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
width: 1,
|
|
|
|
width: 1,
|
|
|
|
color:
|
|
|
|
color:
|
|
|
|
strokeTextField),
|
|
|
|
strokeTextField),
|
|
|
|
borderRadius:
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius
|
|
|
|
BorderRadius.all(
|
|
|
|
.all(Radius
|
|
|
|
Radius.circular(
|
|
|
|
.circular(
|
|
|
|
|
|
|
|
10))),
|
|
|
|
|
|
|
|
contentPadding:
|
|
|
|
|
|
|
|
EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 0,
|
|
|
|
|
|
|
|
bottom: 0,
|
|
|
|
|
|
|
|
left:
|
|
|
|
|
|
|
|
defaultPadding),
|
|
|
|
|
|
|
|
fillColor: bgTextField,
|
|
|
|
|
|
|
|
filled: true,
|
|
|
|
|
|
|
|
focusColor:
|
|
|
|
|
|
|
|
Color.fromRGBO(255,
|
|
|
|
|
|
|
|
255, 255, 0.30),
|
|
|
|
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
|
|
|
|
borderSide: BorderSide(
|
|
|
|
|
|
|
|
width: 1,
|
|
|
|
|
|
|
|
color:
|
|
|
|
|
|
|
|
strokeTextField),
|
|
|
|
|
|
|
|
borderRadius:
|
|
|
|
|
|
|
|
BorderRadius
|
|
|
|
|
|
|
|
.all(Radius
|
|
|
|
|
|
|
|
.circular(
|
|
|
|
|
|
|
|
10))),
|
|
|
|
10))),
|
|
|
|
hintText:
|
|
|
|
hintText: 'Mot de passe',
|
|
|
|
'Mot de passe',
|
|
|
|
hintStyle:
|
|
|
|
hintStyle: GoogleFonts
|
|
|
|
GoogleFonts.plusJakartaSans(
|
|
|
|
.plusJakartaSans(
|
|
|
|
color: strokeTextField),
|
|
|
|
color:
|
|
|
|
|
|
|
|
strokeTextField),
|
|
|
|
|
|
|
|
suffixIcon: Container(
|
|
|
|
suffixIcon: Container(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
EdgeInsets.only(
|
|
|
|
|
|
|
|
right: 10),
|
|
|
|
right: 10),
|
|
|
|
margin:
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
EdgeInsets.all(
|
|
|
|
|
|
|
|
5),
|
|
|
|
|
|
|
|
height: 3,
|
|
|
|
height: 3,
|
|
|
|
child: InkWell(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
if (passenable) {
|
|
|
|
if (passenable) {
|
|
|
|
passenable =
|
|
|
|
passenable = false;
|
|
|
|
false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
passenable =
|
|
|
|
passenable = true;
|
|
|
|
true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, // Image tapped
|
|
|
|
},
|
|
|
|
splashColor: Colors
|
|
|
|
// Image tapped
|
|
|
|
.white10, // Splash color over image
|
|
|
|
splashColor:
|
|
|
|
|
|
|
|
Colors.white10,
|
|
|
|
|
|
|
|
// Splash color over image
|
|
|
|
child: Image(
|
|
|
|
child: Image(
|
|
|
|
image: passenable
|
|
|
|
image: passenable
|
|
|
|
? AssetImage(
|
|
|
|
? AssetImage(
|
|
|
@ -576,14 +243,12 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(top: 10),
|
|
|
|
top: 10.h),
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
"Mot de passe oublié?",
|
|
|
|
"Mot de passe oublié?",
|
|
|
|
style: GoogleFonts
|
|
|
|
style:
|
|
|
|
.plusJakartaSans(
|
|
|
|
GoogleFonts.plusJakartaSans(
|
|
|
|
color: Colors
|
|
|
|
color: Colors.white),
|
|
|
|
.white),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
@ -591,24 +256,24 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
width: 600,
|
|
|
|
width: 600,
|
|
|
|
child: LoginButton()),
|
|
|
|
child: LoginButton(
|
|
|
|
],
|
|
|
|
callback: handleLogin,
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 3,
|
|
|
|
flex: 3,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding:
|
|
|
|
padding: EdgeInsets.only(top: 20),
|
|
|
|
EdgeInsets.only(top: 20),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment:
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
ConstrainedBox(
|
|
|
|
ConstrainedBox(
|
|
|
|
constraints:
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
BoxConstraints(
|
|
|
|
|
|
|
|
maxWidth: 600),
|
|
|
|
maxWidth: 600),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
mainAxisAlignment:
|
|
|
@ -617,8 +282,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
color: Color(
|
|
|
|
color:
|
|
|
|
0xFF3D3D3D),
|
|
|
|
Color(0xFF3D3D3D),
|
|
|
|
height: 1,
|
|
|
|
height: 1,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -631,7 +296,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
defaultPadding),
|
|
|
|
defaultPadding),
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
'Ou',
|
|
|
|
'Ou',
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
style: GoogleFonts
|
|
|
|
|
|
|
|
.plusJakartaSans(
|
|
|
|
color: Colors
|
|
|
|
color: Colors
|
|
|
|
.white,
|
|
|
|
.white,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight:
|
|
|
@ -640,49 +306,42 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child:
|
|
|
|
child: Container(
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: 1,
|
|
|
|
height: 1,
|
|
|
|
color: Color(
|
|
|
|
color:
|
|
|
|
0xFF3D3D3D),
|
|
|
|
Color(0xFF3D3D3D),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height:
|
|
|
|
height: defaultPadding),
|
|
|
|
defaultPadding),
|
|
|
|
|
|
|
|
SignInButton(
|
|
|
|
SignInButton(
|
|
|
|
Buttons.Google,
|
|
|
|
Buttons.Google,
|
|
|
|
text:
|
|
|
|
text: "Login with Google",
|
|
|
|
"Login with Google",
|
|
|
|
|
|
|
|
onPressed: () {},
|
|
|
|
onPressed: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(
|
|
|
|
EdgeInsets.only(top: 20),
|
|
|
|
top: 20),
|
|
|
|
|
|
|
|
child: RichText(
|
|
|
|
child: RichText(
|
|
|
|
textAlign:
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
TextAlign.center,
|
|
|
|
|
|
|
|
text: TextSpan(
|
|
|
|
text: TextSpan(
|
|
|
|
text:
|
|
|
|
text:
|
|
|
|
'Pas encore inscrit?',
|
|
|
|
'Pas encore inscrit?',
|
|
|
|
style: GoogleFonts
|
|
|
|
style: GoogleFonts
|
|
|
|
.plusJakartaSans(
|
|
|
|
.plusJakartaSans(
|
|
|
|
color: Colors
|
|
|
|
color:
|
|
|
|
.white,
|
|
|
|
Colors.white,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight:
|
|
|
|
FontWeight
|
|
|
|
FontWeight
|
|
|
|
.w400,
|
|
|
|
.w400,
|
|
|
|
fontSize:
|
|
|
|
fontSize: 13),
|
|
|
|
13),
|
|
|
|
children: <TextSpan>[
|
|
|
|
children: <
|
|
|
|
|
|
|
|
TextSpan>[
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
TextSpan(
|
|
|
|
text:
|
|
|
|
text: " S’inscire",
|
|
|
|
" S’inscire",
|
|
|
|
style: GoogleFonts
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
.plusJakartaSans(
|
|
|
|
fontSize:
|
|
|
|
fontSize:
|
|
|
|
13,
|
|
|
|
13,
|
|
|
|
fontWeight:
|
|
|
|
fontWeight:
|
|
|
@ -701,9 +360,6 @@ class _LoginScreenState extends State<LoginScreen> {
|
|
|
|
))))
|
|
|
|
))))
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)));
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|