-
Notifications
You must be signed in to change notification settings - Fork 2
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 #19 from SriramPatibanda/login
Welcome Screen
- Loading branch information
Showing
20 changed files
with
438 additions
and
133 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.useAndroidX=true | ||
android.enableJetifier=true | ||
android.enableR8=true |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class LoginModel extends ChangeNotifier { | ||
String _title = "Safenet"; | ||
String get title => _title; | ||
} |
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 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class RegisterModel extends ChangeNotifier { | ||
String _title = "Safenet"; | ||
String get title => _title; | ||
} |
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,20 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
const kTextFieldDecoration = InputDecoration( | ||
hintText: 'Enter a value', | ||
contentPadding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0), | ||
border: OutlineInputBorder( | ||
borderRadius: BorderRadius.all(Radius.circular(10.0)), | ||
), | ||
enabledBorder: OutlineInputBorder( | ||
borderSide: BorderSide(color: Colors.lightBlueAccent, width: 1.0), | ||
borderRadius: BorderRadius.all(Radius.circular(10.0)), | ||
), | ||
focusedBorder: OutlineInputBorder( | ||
borderSide: BorderSide(color: Colors.lightBlueAccent, width: 2.0), | ||
borderRadius: BorderRadius.all(Radius.circular(10.0)), | ||
), | ||
); | ||
|
||
const kSocialMediaDecoration = | ||
BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(10.0))); |
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,34 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class CustomSignInButton extends StatelessWidget { | ||
final Function onPressed; | ||
final String buttonText; | ||
final Color buttonColor; | ||
|
||
CustomSignInButton( | ||
{this.buttonColor, this.buttonText, @required this.onPressed}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Padding( | ||
padding: EdgeInsets.symmetric(vertical: 10.0), | ||
child: Material( | ||
color: buttonColor, | ||
borderRadius: BorderRadius.circular(10.0), | ||
elevation: 5.0, | ||
child: MaterialButton( | ||
onPressed: onPressed, | ||
minWidth: 400.0, | ||
height: 42.0, | ||
child: Text( | ||
buttonText, | ||
style: TextStyle( | ||
color: Colors.white, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} | ||
// Color(0xff0278ae) |
18 changes: 18 additions & 0 deletions
18
app/safenet/lib/ui/customWidgets/facebookSignInButton.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,18 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_signin_button/flutter_signin_button.dart'; | ||
|
||
class FacebookSignInButton extends StatelessWidget { | ||
final String text; | ||
|
||
FacebookSignInButton({this.text}); | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
width: 400, | ||
height: 50.0, | ||
child: SignInButton(Buttons.Facebook, text: text, onPressed: () { | ||
print("Clicked facebook"); | ||
}), | ||
); | ||
} | ||
} |
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,19 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_signin_button/flutter_signin_button.dart'; | ||
|
||
class GoogleSignInButton extends StatelessWidget { | ||
final String text; | ||
|
||
GoogleSignInButton({this.text}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
width: 400, | ||
height: 50.0, | ||
child: SignInButton(Buttons.Google, text: text, onPressed: () { | ||
print("Clicked google"); | ||
}), | ||
); | ||
} | ||
} |
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,19 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:provider/provider.dart'; | ||
import 'package:safenet/core/viewmodals/login_model.dart'; | ||
|
||
class MainTitle extends StatelessWidget { | ||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
child: Text( | ||
Provider.of<LoginModel>(context).title, | ||
style: TextStyle( | ||
fontFamily: 'MontserratExtraBold', | ||
fontWeight: FontWeight.bold, | ||
fontSize: 60.0, | ||
), | ||
), | ||
); | ||
} | ||
} |
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,87 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:safenet/ui/constants.dart'; | ||
import 'package:safenet/ui/customWidgets/customSignInButton.dart'; | ||
import 'package:safenet/ui/customWidgets/facebookSignInButton.dart'; | ||
import 'package:safenet/ui/customWidgets/googleSignInButton.dart'; | ||
import 'package:safenet/ui/customWidgets/mainTitle.dart'; | ||
import 'package:safenet/ui/views/register_view.dart'; | ||
|
||
class LoginView extends StatelessWidget { | ||
static const String id = 'loginView'; | ||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: SafeArea( | ||
child: Padding( | ||
padding: EdgeInsets.symmetric(horizontal: 24.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
SizedBox(height: 120.0), | ||
Center(child: MainTitle()), | ||
SizedBox( | ||
height: 80.0, | ||
), | ||
TextField( | ||
keyboardType: TextInputType.phone, | ||
onChanged: null, | ||
decoration: kTextFieldDecoration.copyWith( | ||
hintText: 'Enter your Phone Number', | ||
prefixIcon: Icon(Icons.person)), | ||
), | ||
SizedBox( | ||
height: 15.0, | ||
), | ||
TextField( | ||
obscureText: true, | ||
onChanged: null, | ||
decoration: kTextFieldDecoration.copyWith( | ||
hintText: 'Enter your Password', | ||
prefixIcon: Icon(Icons.lock_outline)), | ||
), | ||
SizedBox( | ||
height: 15.0, | ||
), | ||
CustomSignInButton( | ||
onPressed: null, | ||
buttonColor: Color(0xff51adcf), | ||
buttonText: "Sign In", | ||
), | ||
SizedBox( | ||
height: 8.0, | ||
), | ||
FlatButton(onPressed: null, child: Text("Forgot Password?")), | ||
SizedBox( | ||
height: 8.0, | ||
), | ||
GoogleSignInButton(), | ||
SizedBox( | ||
height: 15.0, | ||
), | ||
FacebookSignInButton(), | ||
SizedBox( | ||
height: 40.0, | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Text("Don't have an account?"), | ||
FlatButton( | ||
onPressed: () { | ||
Navigator.pushNamed(context, RegisterView.id); | ||
}, | ||
padding: EdgeInsets.only(left: 0.0), | ||
child: Text( | ||
"Create one", | ||
style: TextStyle(color: Color(0xff51adcf)), | ||
), | ||
) | ||
], | ||
) | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.