Skip to content

Commit

Permalink
Finished Login and Password Reset Page
Browse files Browse the repository at this point in the history
  • Loading branch information
emrade committed Aug 4, 2019
1 parent 6722e9e commit ea2f455
Show file tree
Hide file tree
Showing 11 changed files with 389 additions and 26 deletions.
Binary file modified assets/images/home_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion lib/_routing/router.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
import 'package:flutter/material.dart';
import 'package:flutter_social/_routing/routes.dart';
import 'package:flutter_social/views/home.dart';
import 'package:flutter_social/views/login.dart';
import 'package:flutter_social/views/register.dart';
import 'package:flutter_social/views/reset_password.dart';

Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case homeViewRoute:
return MaterialPageRoute(builder: (context) => HomePage());
case loginViewRoute:
return MaterialPageRoute(builder: (context) => HomePage());
return MaterialPageRoute(builder: (context) => LoginPage());
case registerViewRoute:
return MaterialPageRoute(builder: (context) => RegisterPage());
case resetPasswordViewRoute:
return MaterialPageRoute(builder: (context) => ResetPasswordPage());
break;
default:
return MaterialPageRoute(builder: (context) => HomePage());
Expand Down
4 changes: 3 additions & 1 deletion lib/_routing/routes.dart
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';
6 changes: 3 additions & 3 deletions lib/utils/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const secondaryColor = const Color(0xFFFF9F59);
const secondaryLight = const Color(0xFFFF9F59);
const secondaryDark = const Color(0xFFFF9F59);

const Color loginGradientStart = const Color(0xFFfbab66);
const Color loginGradientEnd = const Color(0xFFf7418c);
const Color gradientStart = const Color(0xFFfbab66);
const Color gradientEnd = const Color(0xFFf7418c);

const primaryGradient = const LinearGradient(
colors: const [loginGradientStart, loginGradientEnd],
colors: const [gradientStart, gradientEnd],
stops: const [0.0, 1.0],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';

class AppConfig {
static const appName = "Heart String";
static const appTagline = "A perfect match for everyone";
static const appTagline = "Find your perfect match";
}

class AvailableFonts {
Expand Down
40 changes: 23 additions & 17 deletions lib/views/home.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_social/_routing/routes.dart';
import 'package:flutter_social/utils/colors.dart';
import 'package:flutter_social/utils/utils.dart';

Expand Down Expand Up @@ -31,13 +32,14 @@ class HomePage extends StatelessWidget {
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
fontWeight: FontWeight.w500
),
)
],
);

final loginBtn = InkWell(
onTap: () {},
onTap: () => Navigator.pushNamed(context, loginViewRoute),
child: Container(
height: 60.0,
width: MediaQuery.of(context).size.width,
Expand All @@ -51,7 +53,7 @@ class HomePage extends StatelessWidget {
'LOG IN',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 24.0,
fontSize: 20.0,
color: Colors.white,
),
),
Expand All @@ -69,7 +71,7 @@ class HomePage extends StatelessWidget {
),
child: RaisedButton(
elevation: 5.0,
onPressed: () {},
onPressed: () => Navigator.pushNamed(context, registerViewRoute),
color: Colors.white,
shape: new RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(7.0),
Expand All @@ -78,7 +80,7 @@ class HomePage extends StatelessWidget {
'SIGN UP',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 24.0,
fontSize: 20.0,
),
),
),
Expand All @@ -97,13 +99,12 @@ class HomePage extends StatelessWidget {
);

return Scaffold(
appBar: AppBar(
elevation: 0,
),
body: Stack(
body: Container(
child: Stack(
children: <Widget>[
Container(
color: primaryColor,
padding: EdgeInsets.only(top: 70.0),
decoration: BoxDecoration(gradient: primaryGradient),
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Column(
Expand All @@ -112,18 +113,23 @@ class HomePage extends StatelessWidget {
),
Positioned(
bottom: 0,
child: Container(
height: 200.0,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
image: DecorationImage(
image: AvailableImages.homePage,
fit: BoxFit.cover,
child: Padding(
padding: EdgeInsets.only(left: 10.0),
child: Container(
height: 300.0,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
image: DecorationImage(
image: AvailableImages.homePage,
fit: BoxFit.contain,
),
),
),
),
)
],
));
),
),
);
}
}
181 changes: 181 additions & 0 deletions lib/views/login.dart
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
],
),
),
),
);
}
}
10 changes: 10 additions & 0 deletions lib/views/register.dart
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(

);
}
}
Loading

0 comments on commit ea2f455

Please sign in to comment.