-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished Login and Password Reset Page
- Loading branch information
Showing
11 changed files
with
389 additions
and
26 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
const String homeViewRoute = '/'; | ||
|
||
const String loginViewRoute = 'login'; | ||
const String loginViewRoute = 'login'; | ||
const String registerViewRoute = 'register'; | ||
const String resetPasswordViewRoute = 'reset_password'; |
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
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,181 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_social/_routing/routes.dart'; | ||
import 'package:flutter_social/utils/colors.dart'; | ||
import 'package:line_icons/line_icons.dart'; | ||
|
||
class LoginPage extends StatefulWidget { | ||
@override | ||
_LoginPageState createState() => _LoginPageState(); | ||
} | ||
|
||
class _LoginPageState extends State<LoginPage> { | ||
final _formKey = GlobalKey<FormState>(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final pageTitle = Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Text( | ||
"Log In.", | ||
style: TextStyle( | ||
fontWeight: FontWeight.bold, | ||
color: Colors.white, | ||
fontSize: 45.0, | ||
), | ||
), | ||
Text( | ||
"We missed you!", | ||
style: TextStyle( | ||
color: Colors.white, | ||
fontSize: 18.0, | ||
fontWeight: FontWeight.w500, | ||
), | ||
) | ||
], | ||
); | ||
|
||
final emailField = TextFormField( | ||
decoration: InputDecoration( | ||
labelText: 'Email Address', | ||
labelStyle: TextStyle(color: Colors.white), | ||
prefixIcon: Icon( | ||
LineIcons.envelope, | ||
color: Colors.white, | ||
), | ||
enabledBorder: UnderlineInputBorder( | ||
borderSide: BorderSide(color: Colors.white), | ||
), | ||
focusedBorder: UnderlineInputBorder( | ||
borderSide: BorderSide(color: Colors.white), | ||
), | ||
), | ||
keyboardType: TextInputType.emailAddress, | ||
style: TextStyle(color: Colors.white), | ||
cursorColor: Colors.white, | ||
); | ||
|
||
final passwordField = TextFormField( | ||
decoration: InputDecoration( | ||
labelText: 'Password', | ||
labelStyle: TextStyle(color: Colors.white), | ||
prefixIcon: Icon( | ||
LineIcons.lock, | ||
color: Colors.white, | ||
), | ||
enabledBorder: UnderlineInputBorder( | ||
borderSide: BorderSide(color: Colors.white), | ||
), | ||
focusedBorder: UnderlineInputBorder( | ||
borderSide: BorderSide(color: Colors.white), | ||
), | ||
), | ||
keyboardType: TextInputType.emailAddress, | ||
style: TextStyle(color: Colors.white), | ||
cursorColor: Colors.white, | ||
obscureText: true, | ||
); | ||
|
||
final loginForm = Padding( | ||
padding: EdgeInsets.only(top: 30.0), | ||
child: Form( | ||
key: _formKey, | ||
child: Column( | ||
children: <Widget>[emailField, passwordField], | ||
), | ||
), | ||
); | ||
|
||
final loginBtn = Container( | ||
margin: EdgeInsets.only(top: 40.0), | ||
height: 60.0, | ||
width: MediaQuery.of(context).size.width, | ||
decoration: BoxDecoration( | ||
borderRadius: BorderRadius.circular(7.0), | ||
border: Border.all(color: Colors.white), | ||
color: Colors.white, | ||
), | ||
child: RaisedButton( | ||
elevation: 5.0, | ||
onPressed: () => Navigator.pushNamed(context, homeViewRoute), | ||
color: Colors.white, | ||
shape: new RoundedRectangleBorder( | ||
borderRadius: new BorderRadius.circular(7.0), | ||
), | ||
child: Text( | ||
'SIGN IN', | ||
style: TextStyle( | ||
fontWeight: FontWeight.w800, | ||
fontSize: 20.0, | ||
), | ||
), | ||
), | ||
); | ||
|
||
final forgotPassword = Padding( | ||
padding: EdgeInsets.only(top: 50.0), | ||
child: InkWell( | ||
onTap: () => Navigator.pushNamed(context, resetPasswordViewRoute), | ||
child: Center( | ||
child: Text( | ||
'Forgot Password?', | ||
style: TextStyle( | ||
color: Colors.white70, | ||
fontSize: 18.0, | ||
fontWeight: FontWeight.w600, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
|
||
final newUser = Padding( | ||
padding: EdgeInsets.only(top: 20.0), | ||
child: InkWell( | ||
onTap: () => Navigator.pushNamed(context, registerViewRoute), | ||
child: Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: <Widget>[ | ||
Text( | ||
'New User?', | ||
style: TextStyle( | ||
color: Colors.white70, | ||
fontSize: 18.0, | ||
fontWeight: FontWeight.w600, | ||
), | ||
), | ||
Text( | ||
' Create account', | ||
style: TextStyle( | ||
color: Colors.white, | ||
fontSize: 18.0, | ||
fontWeight: FontWeight.w600, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
|
||
return Scaffold( | ||
body: SingleChildScrollView( | ||
child: Container( | ||
padding: EdgeInsets.only(top: 150.0, left: 30.0, right: 30.0), | ||
decoration: BoxDecoration(gradient: primaryGradient), | ||
height: MediaQuery.of(context).size.height, | ||
width: MediaQuery.of(context).size.width, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
pageTitle, | ||
loginForm, | ||
loginBtn, | ||
forgotPassword, | ||
newUser | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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,10 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class RegisterPage extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
|
||
); | ||
} | ||
} |
Oops, something went wrong.