Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 65b841a

Browse files
Rivaan RanawatRivaan Ranawat
authored andcommitted
added 3 login screens
1 parent c4af38a commit 65b841a

File tree

7 files changed

+554
-0
lines changed

7 files changed

+554
-0
lines changed

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,64 @@ Container(
151151
)
152152
```
153153

154+
### Login Screen 4
155+
156+
![Screenshot on Android](./screenshots/login_screen_4.jpeg)
157+
158+
##### Usage
159+
160+
```
161+
Container(
162+
child: LoginScreen4(
163+
primaryColor: Color(0xff18203d),
164+
secondaryColor: Color(0xff232c51),
165+
logoGreen: Color(0xff25bcbb),
166+
),
167+
)
168+
```
169+
170+
### Login Screen 5
171+
172+
![Screenshot on Android](./screenshots/login_screen_5.jpeg)
173+
174+
##### Usage
175+
176+
```
177+
Container(
178+
child: LoginScreen5(
179+
avatarImage: "path/to/image.png",
180+
onLoginClick: () {
181+
// when login button is pressed
182+
},
183+
googleSignIn: () {
184+
// when google signin button is pressed
185+
},
186+
navigatePage: () {
187+
// change to signup screen
188+
}
189+
),
190+
)
191+
```
192+
193+
### Login Screen 6
194+
195+
![Screenshot on Android](./screenshots/login_screen_6.jpeg)
196+
197+
##### Usage
198+
199+
```
200+
Container(
201+
child: LoginScreen6(
202+
onLoginClick: () {
203+
// when login button is pressed
204+
},
205+
navigatePage: () {
206+
// change to signup screen
207+
}
208+
),
209+
)
210+
```
211+
154212
## Contribution and Donation
155213

156214
Feel free to contribute. If you like the project and want to donate, [click here](https://www.paypal.me/samarthagarwal).

lib/login_screen_4.dart

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
import 'package:flutter/material.dart';
2+
3+
class LoginScreen extends StatefulWidget {
4+
final Color primaryColor;
5+
final Color secondaryColor;
6+
final Color logoGreen;
7+
LoginScreen({
8+
@required this.primaryColor,
9+
@required this.secondaryColor,
10+
@required this.logoGreen,
11+
});
12+
@override
13+
_LoginScreenState createState() => _LoginScreenState();
14+
}
15+
16+
class _LoginScreenState extends State<LoginScreen> {
17+
TextEditingController _emailController = TextEditingController();
18+
TextEditingController _passwordController = TextEditingController();
19+
FocusNode myFocusNode;
20+
21+
@override
22+
void initState() {
23+
super.initState();
24+
myFocusNode = FocusNode();
25+
}
26+
27+
@override
28+
void dispose() {
29+
myFocusNode.dispose();
30+
super.dispose();
31+
}
32+
33+
@override
34+
Widget build(BuildContext context) {
35+
return Scaffold(
36+
backgroundColor: widget.primaryColor,
37+
appBar: AppBar(
38+
backgroundColor: Colors.transparent,
39+
elevation: 0,
40+
),
41+
body: Container(
42+
alignment: Alignment.topCenter,
43+
margin: EdgeInsets.symmetric(horizontal: 30),
44+
child: SingleChildScrollView(
45+
child: Column(
46+
mainAxisAlignment: MainAxisAlignment.center,
47+
crossAxisAlignment: CrossAxisAlignment.center,
48+
children: <Widget>[
49+
Text(
50+
'Login To Continue!',
51+
textAlign: TextAlign.center,
52+
style: TextStyle(color: Colors.white, fontSize: 28),
53+
),
54+
SizedBox(height: 20),
55+
Text(
56+
'Enter your email and password below to continue and be a part of our project!',
57+
textAlign: TextAlign.center,
58+
style: TextStyle(color: Colors.white, fontSize: 14),
59+
),
60+
SizedBox(
61+
height: 50,
62+
),
63+
Container(
64+
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
65+
decoration: BoxDecoration(
66+
color: widget.secondaryColor,
67+
border: Border.all(color: Colors.blue)),
68+
child: TextFormField(
69+
controller: _emailController,
70+
style: TextStyle(color: Colors.white),
71+
decoration: InputDecoration(
72+
contentPadding: EdgeInsets.symmetric(horizontal: 10),
73+
labelText: "Email",
74+
labelStyle: TextStyle(color: Colors.white),
75+
icon: Icon(
76+
Icons.email,
77+
color: Colors.white,
78+
),
79+
border: InputBorder.none,
80+
),
81+
keyboardType: TextInputType.emailAddress,
82+
textInputAction: TextInputAction.next,
83+
onFieldSubmitted: (_) => myFocusNode.requestFocus(),
84+
),
85+
),
86+
SizedBox(height: 20),
87+
Container(
88+
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
89+
decoration: BoxDecoration(
90+
color: widget.secondaryColor,
91+
border: Border.all(color: Colors.blue)),
92+
child: TextFormField(
93+
focusNode: myFocusNode,
94+
controller: _passwordController,
95+
style: TextStyle(color: Colors.white),
96+
decoration: InputDecoration(
97+
contentPadding: EdgeInsets.symmetric(horizontal: 10),
98+
labelText: "Password",
99+
labelStyle: TextStyle(color: Colors.white),
100+
icon: Icon(
101+
Icons.lock,
102+
color: Colors.white,
103+
),
104+
border: InputBorder.none,
105+
),
106+
obscureText: true,
107+
),
108+
),
109+
SizedBox(height: 30),
110+
MaterialButton(
111+
elevation: 0,
112+
minWidth: double.maxFinite,
113+
height: 50,
114+
onPressed: () {},
115+
color: widget.logoGreen,
116+
child: Text('Login',
117+
style: TextStyle(color: Colors.white, fontSize: 16)),
118+
textColor: Colors.white,
119+
),
120+
SizedBox(height: 20),
121+
MaterialButton(
122+
elevation: 0,
123+
minWidth: double.maxFinite,
124+
height: 50,
125+
onPressed: () {},
126+
color: Colors.blue,
127+
child: Row(
128+
mainAxisAlignment: MainAxisAlignment.center,
129+
children: <Widget>[
130+
Text('Sign In using Google',
131+
style: TextStyle(color: Colors.white, fontSize: 16)),
132+
],
133+
),
134+
textColor: Colors.white,
135+
),
136+
SizedBox(height: 100),
137+
Align(
138+
alignment: Alignment.bottomCenter,
139+
child: Row(
140+
mainAxisAlignment: MainAxisAlignment.center,
141+
children: <Widget>[
142+
GestureDetector(
143+
onTap: () {},
144+
child: Text('Sign Up?',
145+
textAlign: TextAlign.center,
146+
style: TextStyle(
147+
color: Colors.white,
148+
fontSize: 20,
149+
fontWeight: FontWeight.bold)),
150+
),
151+
],
152+
),
153+
)
154+
],
155+
),
156+
),
157+
),
158+
);
159+
}
160+
}

lib/login_screen_6.dart

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
import "package:flutter/material.dart";
2+
3+
class LoginScreen3 extends StatefulWidget {
4+
final Function onLoginClick;
5+
final Function navigatePage;
6+
LoginScreen3({
7+
@required this.onLoginClick,
8+
@required this.navigatePage,
9+
});
10+
@override
11+
_LoginScreen3State createState() => _LoginScreen3State();
12+
}
13+
14+
class _LoginScreen3State extends State<LoginScreen3> {
15+
final TextEditingController emailController = TextEditingController();
16+
final TextEditingController passwordController = TextEditingController();
17+
@override
18+
Widget build(BuildContext context) {
19+
return Scaffold(
20+
body: SingleChildScrollView(
21+
child: Stack(
22+
children: [
23+
Container(
24+
height: MediaQuery.of(context).size.height,
25+
width: MediaQuery.of(context).size.width,
26+
decoration: BoxDecoration(
27+
image: DecorationImage(
28+
image: AssetImage(
29+
"assets/images/background_image_one_signin.png"),
30+
fit: BoxFit.fill,
31+
),
32+
),
33+
),
34+
Column(
35+
crossAxisAlignment: CrossAxisAlignment.start,
36+
children: [
37+
Container(
38+
margin: EdgeInsets.only(left: 40, right: 8, top: 155),
39+
child: Text(
40+
"Welcome\nBack",
41+
style: TextStyle(
42+
color: Colors.white,
43+
fontSize: 30,
44+
fontWeight: FontWeight.bold),
45+
),
46+
),
47+
Padding(
48+
padding: const EdgeInsets.all(15.0),
49+
child: Container(
50+
margin: EdgeInsets.only(
51+
left: 30,
52+
right: 30,
53+
top: MediaQuery.of(context).size.height * 0.24),
54+
width: double.infinity,
55+
child: TextField(
56+
controller: widget.emailController,
57+
style: TextStyle(color: Color.fromRGBO(41, 41, 41, 1)),
58+
decoration: InputDecoration(
59+
hintText: "Email",
60+
hintStyle:
61+
TextStyle(color: Color.fromRGBO(121, 121, 121, 1)),
62+
),
63+
keyboardType: TextInputType.emailAddress,
64+
),
65+
),
66+
),
67+
Padding(
68+
padding: const EdgeInsets.all(15.0),
69+
child: Container(
70+
margin: EdgeInsets.only(left: 30, right: 30),
71+
width: double.infinity,
72+
child: TextField(
73+
controller: widget.passwordController,
74+
style: TextStyle(color: Color.fromRGBO(41, 41, 41, 1)),
75+
decoration: InputDecoration(
76+
hintText: "Password",
77+
hintStyle:
78+
TextStyle(color: Color.fromRGBO(121, 121, 121, 1)),
79+
),
80+
keyboardType: TextInputType.emailAddress,
81+
obscureText: true,
82+
),
83+
),
84+
),
85+
Row(
86+
children: [
87+
Padding(
88+
padding: const EdgeInsets.all(50),
89+
child: Text(
90+
"Sign in",
91+
style: TextStyle(
92+
color: Colors.black,
93+
fontSize: 25,
94+
fontWeight: FontWeight.bold,
95+
),
96+
),
97+
),
98+
Container(
99+
margin: EdgeInsets.only(left: 120),
100+
child: ClipOval(
101+
child: Material(
102+
color: Color.fromRGBO(78, 82, 91, 1),
103+
child: InkWell(
104+
child: SizedBox(
105+
width: 56,
106+
height: 56,
107+
child: Icon(
108+
Icons.arrow_right,
109+
color: Colors.white,
110+
),
111+
),
112+
onTap: widget.onLoginClick,
113+
),
114+
),
115+
))
116+
],
117+
),
118+
SizedBox(height: MediaQuery.of(context).size.height * 0.014),
119+
Padding(
120+
padding: const EdgeInsets.only(left: 40.0),
121+
child: TextButton(
122+
child: Text(
123+
"Sign up",
124+
style: TextStyle(
125+
color: Colors.black,
126+
fontWeight: FontWeight.bold,
127+
decoration: TextDecoration.underline,
128+
fontSize: 15,
129+
),
130+
),
131+
onPressed: widget.navigatePage,
132+
),
133+
),
134+
],
135+
),
136+
],
137+
),
138+
),
139+
);
140+
}
141+
}

0 commit comments

Comments
 (0)