From af9a6507f50fbf61a51bf7829d0c342863b7d1e2 Mon Sep 17 00:00:00 2001 From: Frederik Benoist Date: Sun, 26 Feb 2023 15:15:02 +0100 Subject: [PATCH] Ajout log + sign_in --- assets/images/logo_dark.png | Bin 0 -> 14692 bytes lib/ui/authentication/signin.dart | 385 ++++++++++++-------------- lib/ui/authentication/signin_old.dart | 250 +++++++++++++++++ lib/ui/home/tab_home.dart | 2 +- pubspec.lock | 8 + pubspec.yaml | 2 + 6 files changed, 440 insertions(+), 207 deletions(-) create mode 100644 assets/images/logo_dark.png create mode 100644 lib/ui/authentication/signin_old.dart diff --git a/assets/images/logo_dark.png b/assets/images/logo_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..23c18eece401ed03c9c6006acbdcdd15b485a34a GIT binary patch literal 14692 zcmeHuc|6qZ`u}GTAyg`rNQ^CEY=bFV)*)L+_GQc;+zFh}lxY3miv4O>2=+MoZ?5?Z%R%vYD7mRCDyzd4WEDNs z-DMS2l+|S26)3ghwXdc6Qt=r;s>TmK^&JOWUlj-ReWxWkm-iXMt8 zvWn^+9qy9S5;P0KzYF3JYZ_SYBLY^2J_L)_qSTVS>*w0gu`GkG+aSV zRv8Xcly!qCyUD64s;kHo^*ApysPrEM|A$ye z00xV53r6dBf%uK`$OEq{;~C7IMfv2%1W|o7zKA(xFQ%AcQgzoi-BX5RN*L? zG8(P;>*@c{dUb>n{8#Ayo7Vs0T$Goazb6``UwP4g|2)dd9&UG4g*?@ptBa7x_)U^Xn?GiTXDD*}Z`mKl?wlKgc@4V0Y(#t#umg z9w(7{I@aMg=PA+m#Uq@?KlPeemKGKm{LyU!4Y*AaTgi-f zSNc8Q6EkTctJsYg#;oQzy>#XkZETd%wm@B)U04|Hdq=x8cc73}>hewt1fFyf@~1=D zb*=`5p));m4>xf11mo2Y9ph#Gxu@(av*m{Tqdp5y(DuLTNEi=v#?i|ZFtZSD;i``t zd7@M?pQ1J!(i?Gx^UA`SxXR~@)KS@hQt>CS`m*@t=$lTBUcz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cb=r3_F6iWs1X|5 z$;g~Jal(wpwbTO8p7~75LGngkG+i9ST`65JBy*z;Li08x&Ib2+9w&0g9mu2ec|4K^ zj3~Lw@Kw)d&oJz%vu%V0oA;{(US@G8{7b-dqM3DN7p+<{wi%%U8#J_M1$*0$*^I}c z``I;YD8lee?u}jS%*2_niVba&pOsAbiQ8KNDd6aAkQ&y9{mczHudv?HBIV6ZYgcnw z+mvO(!wj*lTGCt)Jp;&Ai_p;_bg1CE`LUHd^`Pj92_na7rRsbu^=ZrK`u8QpRXMiw zxQ)~TiuBGS(NHjKacg6Hl_+*$$PwN|$jXilA zQ5@Szp_eYy&c3{ylmP_%$Nb}|9=s@Sqj-)x-)j-1&FtZ&%MAFJ_ zmF$_E`@}ixm6}FVbM<}4LkafpfM) zChFsY#HV|4jG2{w?QJ`Nlgj%=Qu8<}F5yjGsuP*CSA#mS$F3~o)PN^VE=b(LA{7tP zrJvT3)B4qqu97)6D-mRLNH$$l%G*Yl`Wl?w=N5l6U75-_6J7jf|MvolZ++yWffecwdHVJR=@_kF3^BTO;SGp#ozI1d#yP6{)w1t)9}e k75Ys<`rqNd=Mtt?!Iz%xW^Q-Z!Sw)A-%PLKsOy>k0~cl)?EnA( literal 0 HcmV?d00001 diff --git a/lib/ui/authentication/signin.dart b/lib/ui/authentication/signin.dart index 7019d2f..301d2af 100644 --- a/lib/ui/authentication/signin.dart +++ b/lib/ui/authentication/signin.dart @@ -1,10 +1,8 @@ -import 'package:mobdr/config/global_style.dart'; -import 'package:mobdr/ui/authentication/forgot_password.dart'; +import 'package:universal_io/io.dart'; import 'package:mobdr/ui/home.dart'; -import 'package:mobdr/ui/authentication/signup.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:fluttertoast/fluttertoast.dart'; -import 'package:mobdr/config/constant.dart'; class SigninPage extends StatefulWidget { @override @@ -12,10 +10,14 @@ class SigninPage extends StatefulWidget { } class _SigninPageState extends State { - TextEditingController _etEmail = TextEditingController(); bool _obscureText = true; IconData _iconVisible = Icons.visibility_off; + Color _gradientTop = Color(0xFF039be6); + Color _gradientBottom = Color(0xFF0299e2); + Color _mainColor = Color(0xFF0181cc); + Color _underlineColor = Color(0xFFCCCCCC); + void _toggleObscureText() { setState(() { _obscureText = !_obscureText; @@ -34,217 +36,188 @@ class _SigninPageState extends State { @override void dispose() { - _etEmail.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return Scaffold( - body: ListView( - padding: EdgeInsets.fromLTRB(30, 120, 30, 30), - children: [ - Center(child: Image.asset('assets/images/logo.png', height: 32)), - SizedBox( - height: 80, - ), - Text('Sign In', style: GlobalStyle.authTitle), - TextFormField( - keyboardType: TextInputType.emailAddress, - controller: _etEmail, - style: TextStyle(color: CHARCOAL), - onChanged: (textValue) { - setState(() {}); - }, - decoration: InputDecoration( - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC)), - ), - labelText: 'Email', - labelStyle: TextStyle(color: BLACK_GREY), - ), - ), - SizedBox( - height: 20, - ), - TextField( - obscureText: _obscureText, - style: TextStyle(color: CHARCOAL), - decoration: InputDecoration( - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)), - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC)), - ), - labelText: 'Password', - labelStyle: TextStyle(color: BLACK_GREY), - suffixIcon: IconButton( - icon: Icon(_iconVisible, color: Colors.grey[400], size: 20), - onPressed: () { - _toggleObscureText(); - }), - ), - ), - SizedBox( - height: 20, - ), - Align( - alignment: Alignment.centerRight, - child: Container( - child: GestureDetector( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ForgotPasswordPage())); - FocusScope.of(context).unfocus(); - }, - child: Text( - 'Forgot Password?', - style: TextStyle(color: PRIMARY_COLOR, fontSize: 13), - ), - ), - )), - SizedBox( - height: 40, - ), - Container( - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.resolveWith( - (Set states) => PRIMARY_COLOR, - ), - overlayColor: MaterialStateProperty.all(Colors.transparent), - shape: MaterialStateProperty.all(RoundedRectangleBorder( - borderRadius: BorderRadius.circular(3.0), - )), - ), - onPressed: () { - //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); - Navigator.pushReplacement(context, - MaterialPageRoute(builder: (context) => HomePage())); - }, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 5.0), - child: Text( - 'Login', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - color: Colors.white), - textAlign: TextAlign.center, - ), - )), - ), - SizedBox( - height: 40, - ), - Center( - child: Text( - 'Or sign in with', - style: GlobalStyle.authSignWith, - ), - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.fromLTRB(20, 0, 20, 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + backgroundColor: Colors.white, + body: AnnotatedRegion( + value: Platform.isIOS + ? SystemUiOverlayStyle.light + : SystemUiOverlayStyle(statusBarIconBrightness: Brightness.light), + child: Stack( children: [ - GestureDetector( - onTap: () { - //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); - Navigator.pushReplacement(context, - MaterialPageRoute(builder: (context) => HomePage())); - Fluttertoast.showToast( - msg: 'Sign in with Google', - toastLength: Toast.LENGTH_LONG); - }, - child: Image( - image: AssetImage("assets/images/google.png"), - width: 40, - ), + // top blue background gradient + Container( + height: MediaQuery.of(context).size.height / 3.5, + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [_gradientTop, _gradientBottom], + begin: Alignment.topCenter, + end: Alignment.bottomCenter)), ), - GestureDetector( - onTap: () { - //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); - Navigator.pushReplacement(context, - MaterialPageRoute(builder: (context) => HomePage())); - Fluttertoast.showToast( - msg: 'Sign in with Facebook', - toastLength: Toast.LENGTH_LONG); - }, - child: Image( - image: AssetImage("assets/images/facebook.png"), - width: 40, - ), - ), - GestureDetector( - onTap: () { - //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); - Navigator.pushReplacement(context, - MaterialPageRoute(builder: (context) => HomePage())); - Fluttertoast.showToast( - msg: 'Sign in with Twitter', - toastLength: Toast.LENGTH_LONG); - }, - child: Image( - image: AssetImage("assets/images/twitter.png"), - width: 40, - ), + // set your logo here + Container( + margin: EdgeInsets.fromLTRB( + 0, MediaQuery.of(context).size.height / 20, 0, 0), + alignment: Alignment.topCenter, + child: + Image.asset('assets/images/logo_dark.png', height: 120)), + ListView( + children: [ + // create form login + Card( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + elevation: 5, + margin: EdgeInsets.fromLTRB(32, + MediaQuery.of(context).size.height / 3.5 - 72, 32, 0), + color: Colors.white, + child: Container( + margin: EdgeInsets.fromLTRB(24, 0, 24, 20), + child: Column( + children: [ + SizedBox( + height: 40, + ), + Center( + child: Text( + 'SIGN IN', + style: TextStyle( + color: _mainColor, + fontSize: 18, + fontWeight: FontWeight.w900), + ), + ), + SizedBox( + height: 20, + ), + TextField( + keyboardType: TextInputType.emailAddress, + decoration: InputDecoration( + focusedBorder: UnderlineInputBorder( + borderSide: + BorderSide(color: Colors.grey[600]!)), + enabledBorder: UnderlineInputBorder( + borderSide: + BorderSide(color: _underlineColor), + ), + labelText: 'Email', + labelStyle: + TextStyle(color: Colors.grey[700])), + ), + SizedBox( + height: 20, + ), + TextField( + obscureText: _obscureText, + decoration: InputDecoration( + focusedBorder: UnderlineInputBorder( + borderSide: + BorderSide(color: Colors.grey[600]!)), + enabledBorder: UnderlineInputBorder( + borderSide: + BorderSide(color: _underlineColor), + ), + labelText: 'Password', + labelStyle: TextStyle(color: Colors.grey[700]), + suffixIcon: IconButton( + icon: Icon(_iconVisible, + color: Colors.grey[700], size: 20), + onPressed: () { + _toggleObscureText(); + }), + ), + ), + SizedBox( + height: 20, + ), + Align( + alignment: Alignment.centerRight, + child: GestureDetector( + onTap: () { + Fluttertoast.showToast( + msg: 'Click forgot password', + toastLength: Toast.LENGTH_SHORT); + }, + child: Text( + 'Forgot Password?', + style: TextStyle(fontSize: 13), + ), + ), + ), + SizedBox( + height: 40, + ), + SizedBox( + width: double.maxFinite, + child: TextButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty + .resolveWith( + (Set states) => _mainColor, + ), + overlayColor: MaterialStateProperty.all( + Colors.transparent), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + )), + ), + onPressed: () { + //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); + Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => HomePage())); + }, + child: Padding( + padding: + const EdgeInsets.symmetric(vertical: 5), + child: Text( + 'LOGIN', + style: TextStyle( + fontSize: 16, color: Colors.white), + textAlign: TextAlign.center, + ), + )), + ), + ], + )), + ), + SizedBox( + height: 50, + ), + // create sign up link + Center( + child: Wrap( + children: [ + Text('New User? '), + GestureDetector( + onTap: () { + Fluttertoast.showToast( + msg: 'Click signup', + toastLength: Toast.LENGTH_SHORT); + }, + child: Text( + 'Sign Up', + style: TextStyle( + color: _mainColor, fontWeight: FontWeight.w700), + ), + ) + ], + ), + ), + SizedBox( + height: 20, + ), + ], ) ], ), - ), - SizedBox( - height: 20, - ), - Center( - child: GestureDetector( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => SignupPage())); - FocusScope.of(context).unfocus(); - }, - child: Wrap( - children: [ - Text( - 'No account yet? ', - style: GlobalStyle.authBottom1, - ), - Text( - 'Create one', - style: GlobalStyle.authBottom2, - ) - ], - ), - ), - ), - SizedBox( - height: 30, - ), - Center( - child: GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GlobalStyle.iconBack, - Text( - ' Back', - style: GlobalStyle.back, - ) - ], - ), - ), - ), - ], - )); + )); } } diff --git a/lib/ui/authentication/signin_old.dart b/lib/ui/authentication/signin_old.dart new file mode 100644 index 0000000..7019d2f --- /dev/null +++ b/lib/ui/authentication/signin_old.dart @@ -0,0 +1,250 @@ +import 'package:mobdr/config/global_style.dart'; +import 'package:mobdr/ui/authentication/forgot_password.dart'; +import 'package:mobdr/ui/home.dart'; +import 'package:mobdr/ui/authentication/signup.dart'; +import 'package:flutter/material.dart'; +import 'package:fluttertoast/fluttertoast.dart'; +import 'package:mobdr/config/constant.dart'; + +class SigninPage extends StatefulWidget { + @override + _SigninPageState createState() => _SigninPageState(); +} + +class _SigninPageState extends State { + TextEditingController _etEmail = TextEditingController(); + bool _obscureText = true; + IconData _iconVisible = Icons.visibility_off; + + void _toggleObscureText() { + setState(() { + _obscureText = !_obscureText; + if (_obscureText == true) { + _iconVisible = Icons.visibility_off; + } else { + _iconVisible = Icons.visibility; + } + }); + } + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + _etEmail.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: ListView( + padding: EdgeInsets.fromLTRB(30, 120, 30, 30), + children: [ + Center(child: Image.asset('assets/images/logo.png', height: 32)), + SizedBox( + height: 80, + ), + Text('Sign In', style: GlobalStyle.authTitle), + TextFormField( + keyboardType: TextInputType.emailAddress, + controller: _etEmail, + style: TextStyle(color: CHARCOAL), + onChanged: (textValue) { + setState(() {}); + }, + decoration: InputDecoration( + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC)), + ), + labelText: 'Email', + labelStyle: TextStyle(color: BLACK_GREY), + ), + ), + SizedBox( + height: 20, + ), + TextField( + obscureText: _obscureText, + style: TextStyle(color: CHARCOAL), + decoration: InputDecoration( + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: PRIMARY_COLOR, width: 2.0)), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC)), + ), + labelText: 'Password', + labelStyle: TextStyle(color: BLACK_GREY), + suffixIcon: IconButton( + icon: Icon(_iconVisible, color: Colors.grey[400], size: 20), + onPressed: () { + _toggleObscureText(); + }), + ), + ), + SizedBox( + height: 20, + ), + Align( + alignment: Alignment.centerRight, + child: Container( + child: GestureDetector( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ForgotPasswordPage())); + FocusScope.of(context).unfocus(); + }, + child: Text( + 'Forgot Password?', + style: TextStyle(color: PRIMARY_COLOR, fontSize: 13), + ), + ), + )), + SizedBox( + height: 40, + ), + Container( + child: TextButton( + style: ButtonStyle( + backgroundColor: MaterialStateProperty.resolveWith( + (Set states) => PRIMARY_COLOR, + ), + overlayColor: MaterialStateProperty.all(Colors.transparent), + shape: MaterialStateProperty.all(RoundedRectangleBorder( + borderRadius: BorderRadius.circular(3.0), + )), + ), + onPressed: () { + //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); + Navigator.pushReplacement(context, + MaterialPageRoute(builder: (context) => HomePage())); + }, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 5.0), + child: Text( + 'Login', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.white), + textAlign: TextAlign.center, + ), + )), + ), + SizedBox( + height: 40, + ), + Center( + child: Text( + 'Or sign in with', + style: GlobalStyle.authSignWith, + ), + ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.fromLTRB(20, 0, 20, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); + Navigator.pushReplacement(context, + MaterialPageRoute(builder: (context) => HomePage())); + Fluttertoast.showToast( + msg: 'Sign in with Google', + toastLength: Toast.LENGTH_LONG); + }, + child: Image( + image: AssetImage("assets/images/google.png"), + width: 40, + ), + ), + GestureDetector( + onTap: () { + //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); + Navigator.pushReplacement(context, + MaterialPageRoute(builder: (context) => HomePage())); + Fluttertoast.showToast( + msg: 'Sign in with Facebook', + toastLength: Toast.LENGTH_LONG); + }, + child: Image( + image: AssetImage("assets/images/facebook.png"), + width: 40, + ), + ), + GestureDetector( + onTap: () { + //Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(builder: (context) => HomePage()), (Route route) => false); + Navigator.pushReplacement(context, + MaterialPageRoute(builder: (context) => HomePage())); + Fluttertoast.showToast( + msg: 'Sign in with Twitter', + toastLength: Toast.LENGTH_LONG); + }, + child: Image( + image: AssetImage("assets/images/twitter.png"), + width: 40, + ), + ) + ], + ), + ), + SizedBox( + height: 20, + ), + Center( + child: GestureDetector( + onTap: () { + Navigator.push(context, + MaterialPageRoute(builder: (context) => SignupPage())); + FocusScope.of(context).unfocus(); + }, + child: Wrap( + children: [ + Text( + 'No account yet? ', + style: GlobalStyle.authBottom1, + ), + Text( + 'Create one', + style: GlobalStyle.authBottom2, + ) + ], + ), + ), + ), + SizedBox( + height: 30, + ), + Center( + child: GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GlobalStyle.iconBack, + Text( + ' Back', + style: GlobalStyle.back, + ) + ], + ), + ), + ), + ], + )); + } +} diff --git a/lib/ui/home/tab_home.dart b/lib/ui/home/tab_home.dart index c4c9ac6..875cb6e 100644 --- a/lib/ui/home/tab_home.dart +++ b/lib/ui/home/tab_home.dart @@ -329,7 +329,7 @@ class _TabHomePageState extends State ), SizedBox(width: 8), Text( - 'Search Product', + 'Search Product a', style: TextStyle( color: Colors.grey[500], fontWeight: FontWeight.normal), diff --git a/pubspec.lock b/pubspec.lock index 5fce04a..88a76c2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -445,6 +445,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + universal_io: + dependency: "direct main" + description: + name: universal_io + sha256: "06866290206d196064fd61df4c7aea1ffe9a4e7c4ccaa8fcded42dd41948005d" + url: "https://pub.dev" + source: hosted + version: "2.2.0" uuid: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d5cdc33..37af339 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,6 +41,7 @@ dependencies: intl: 0.17.0 carousel_slider: 4.2.1 cached_network_image: 3.2.3 + universal_io: 2.2.0 dev_dependencies: flutter_test: @@ -105,4 +106,5 @@ flutter: - assets/images/visa.png - assets/images/mastercard.png - assets/images/logo.png + - assets/images/logo_dark.png - assets/images/onboarding/search_product.gif \ No newline at end of file