Skip to content

Commit caf718c

Browse files
committed
Make login page
1 parent 0bf6183 commit caf718c

File tree

1 file changed

+135
-0
lines changed

1 file changed

+135
-0
lines changed

lib/login.dart

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:login_page_day_23/animation/FadeAnimation.dart';
3+
4+
class LoginPage extends StatelessWidget {
5+
@override
6+
Widget build(BuildContext context) {
7+
return Scaffold(
8+
resizeToAvoidBottomInset: false,
9+
backgroundColor: Colors.white,
10+
appBar: AppBar(
11+
elevation: 0,
12+
brightness: Brightness.light,
13+
backgroundColor: Colors.white,
14+
leading: IconButton(
15+
onPressed: () {
16+
Navigator.pop(context);
17+
},
18+
icon: Icon(Icons.arrow_back_ios, size: 20, color: Colors.black,),
19+
),
20+
),
21+
body: Container(
22+
height: MediaQuery.of(context).size.height,
23+
width: double.infinity,
24+
child: Column(
25+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
26+
children: <Widget>[
27+
Expanded(
28+
child: Column(
29+
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
30+
children: <Widget>[
31+
Column(
32+
children: <Widget>[
33+
FadeAnimation(1, Text("Login", style: TextStyle(
34+
fontSize: 30,
35+
fontWeight: FontWeight.bold
36+
),)),
37+
SizedBox(height: 20,),
38+
FadeAnimation(1.2, Text("Login to your account", style: TextStyle(
39+
fontSize: 15,
40+
color: Colors.grey[700]
41+
),)),
42+
],
43+
),
44+
Padding(
45+
padding: EdgeInsets.symmetric(horizontal: 40),
46+
child: Column(
47+
children: <Widget>[
48+
FadeAnimation(1.2, makeInput(label: "Email")),
49+
FadeAnimation(1.3, makeInput(label: "Password", obscureText: true)),
50+
],
51+
),
52+
),
53+
FadeAnimation(1.4, Padding(
54+
padding: EdgeInsets.symmetric(horizontal: 40),
55+
child: Container(
56+
padding: EdgeInsets.only(top: 3, left: 3),
57+
decoration: BoxDecoration(
58+
borderRadius: BorderRadius.circular(50),
59+
border: Border(
60+
bottom: BorderSide(color: Colors.black),
61+
top: BorderSide(color: Colors.black),
62+
left: BorderSide(color: Colors.black),
63+
right: BorderSide(color: Colors.black),
64+
)
65+
),
66+
child: MaterialButton(
67+
minWidth: double.infinity,
68+
height: 60,
69+
onPressed: () {},
70+
color: Colors.greenAccent,
71+
elevation: 0,
72+
shape: RoundedRectangleBorder(
73+
borderRadius: BorderRadius.circular(50)
74+
),
75+
child: Text("Login", style: TextStyle(
76+
fontWeight: FontWeight.w600,
77+
fontSize: 18
78+
),),
79+
),
80+
),
81+
)),
82+
FadeAnimation(1.5, Row(
83+
mainAxisAlignment: MainAxisAlignment.center,
84+
children: <Widget>[
85+
Text("Don't have an account?"),
86+
Text("Sign up", style: TextStyle(
87+
fontWeight: FontWeight.w600, fontSize: 18
88+
),),
89+
],
90+
))
91+
],
92+
),
93+
),
94+
FadeAnimation(1.2, Container(
95+
height: MediaQuery.of(context).size.height / 3,
96+
decoration: BoxDecoration(
97+
image: DecorationImage(
98+
image: AssetImage('assets/background.png'),
99+
fit: BoxFit.cover
100+
)
101+
),
102+
))
103+
],
104+
),
105+
),
106+
);
107+
}
108+
109+
Widget makeInput({label, obscureText = false}) {
110+
return Column(
111+
crossAxisAlignment: CrossAxisAlignment.start,
112+
children: <Widget>[
113+
Text(label, style: TextStyle(
114+
fontSize: 15,
115+
fontWeight: FontWeight.w400,
116+
color: Colors.black87
117+
),),
118+
SizedBox(height: 5,),
119+
TextField(
120+
obscureText: obscureText,
121+
decoration: InputDecoration(
122+
contentPadding: EdgeInsets.symmetric(vertical: 0, horizontal: 10),
123+
enabledBorder: OutlineInputBorder(
124+
borderSide: BorderSide(color: Colors.grey[400])
125+
),
126+
border: OutlineInputBorder(
127+
borderSide: BorderSide(color: Colors.grey[400])
128+
),
129+
),
130+
),
131+
SizedBox(height: 30,),
132+
],
133+
);
134+
}
135+
}

0 commit comments

Comments
 (0)