|
@@ -1,201 +0,0 @@
|
1
|
|
-
|
2
|
|
-
|
3
|
|
-import 'package:flutter_login/flutter_login.dart';
|
4
|
|
-import 'package:flutter/material.dart';
|
5
|
|
-import 'package:google_fonts/google_fonts.dart';
|
6
|
|
-import 'register.dart';
|
7
|
|
-
|
8
|
|
-
|
9
|
|
-
|
10
|
|
-
|
11
|
|
-
|
12
|
|
-class WelcomePage extends StatefulWidget {
|
13
|
|
- WelcomePage({Key key, this.title}) : super(key: key);
|
14
|
|
-
|
15
|
|
- final String title;
|
16
|
|
-
|
17
|
|
- @override
|
18
|
|
- _WelcomePageState createState() => _WelcomePageState();
|
19
|
|
-}
|
20
|
|
-
|
21
|
|
-class _WelcomePageState extends State<WelcomePage> {
|
22
|
|
-
|
23
|
|
- TextEditingController email;
|
24
|
|
- TextEditingController password;
|
25
|
|
-
|
26
|
|
- Widget _message(BuildContext context){
|
27
|
|
- return RichText(
|
28
|
|
- textAlign: TextAlign.center,
|
29
|
|
- text: TextSpan(
|
30
|
|
- text: "Don't have an account?",
|
31
|
|
- style: GoogleFonts.cabin(
|
32
|
|
- fontSize: 18,
|
33
|
|
- color: Colors.black
|
34
|
|
- )
|
35
|
|
- ),
|
36
|
|
- );
|
37
|
|
- }
|
38
|
|
-
|
39
|
|
- Widget _title(BuildContext context){
|
40
|
|
- return RichText(
|
41
|
|
- textAlign: TextAlign.center,
|
42
|
|
- text: TextSpan(
|
43
|
|
- text: "Welcome to FastMed",
|
44
|
|
- style: GoogleFonts.cabin(
|
45
|
|
- fontSize: 30,
|
46
|
|
- color: Colors.red
|
47
|
|
- )
|
48
|
|
- ),
|
49
|
|
- );
|
50
|
|
-
|
51
|
|
- }
|
52
|
|
-
|
53
|
|
- Widget _LoginField(String title, TextEditingController controller, {bool pass = false}){
|
54
|
|
- return Container(
|
55
|
|
- padding: EdgeInsets.only(left: 0, top: 10, bottom: 10),
|
56
|
|
- child: Column(
|
57
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
58
|
|
-
|
59
|
|
- children: <Widget> [
|
60
|
|
- Text(
|
61
|
|
- title,
|
62
|
|
- style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
63
|
|
- ),
|
64
|
|
- SizedBox(
|
65
|
|
- height: 30
|
66
|
|
- ),
|
67
|
|
- TextField(
|
68
|
|
- controller: controller,
|
69
|
|
- obscureText: pass,
|
70
|
|
- decoration: InputDecoration(
|
71
|
|
- border: (
|
72
|
|
- UnderlineInputBorder(
|
73
|
|
-
|
74
|
|
- )
|
75
|
|
- ),
|
76
|
|
- ),
|
77
|
|
- ),
|
78
|
|
- ]
|
79
|
|
- ),
|
80
|
|
-
|
81
|
|
- );
|
82
|
|
- }
|
83
|
|
-
|
84
|
|
- Widget _Fills(){
|
85
|
|
- return Column(
|
86
|
|
- children: <Widget> [
|
87
|
|
- _LoginField("Email", email),
|
88
|
|
- _LoginField("Password", password, pass: true),
|
89
|
|
-
|
90
|
|
- ]
|
91
|
|
- );
|
92
|
|
- }
|
93
|
|
-
|
94
|
|
-
|
95
|
|
-
|
96
|
|
- // Widget _LogInButton(BuildContext context){
|
97
|
|
- // return InkWell(
|
98
|
|
- // // onTap: () {
|
99
|
|
- // // Navigator.push(context, MaterialPageRoute(builder: (context)) => __LoginPage())
|
100
|
|
- // // },
|
101
|
|
- // child: Container(
|
102
|
|
- // // width: MediaQuery.of(context).size.width,
|
103
|
|
- // width: 200,
|
104
|
|
- // // height: ,
|
105
|
|
- // padding: EdgeInsets.symmetric(vertical:8),
|
106
|
|
- // alignment: Alignment.center,
|
107
|
|
- // decoration: BoxDecoration(
|
108
|
|
- // color: Colors.red,
|
109
|
|
- // // shape:
|
110
|
|
- //
|
111
|
|
- // borderRadius: BorderRadius.circular(30),
|
112
|
|
- // ),
|
113
|
|
- // child: Text(
|
114
|
|
- // "Login",
|
115
|
|
- // style: TextStyle(fontSize: 25, color: Colors.white),
|
116
|
|
- // ),
|
117
|
|
- //
|
118
|
|
- // )
|
119
|
|
- // );
|
120
|
|
- // }
|
121
|
|
-
|
122
|
|
- Widget _RegisterButton(BuildContext context){
|
123
|
|
- return InkWell(
|
124
|
|
- onTap: () {
|
125
|
|
- Navigator.push(
|
126
|
|
- context, MaterialPageRoute(builder: (context) => RegisterPage()));
|
127
|
|
- },
|
128
|
|
- child: Container(
|
129
|
|
- // width: MediaQuery.of(context).size.width,
|
130
|
|
- width: 180,
|
131
|
|
- padding: EdgeInsets.symmetric(vertical:8),
|
132
|
|
- alignment: Alignment.center,
|
133
|
|
- decoration: BoxDecoration(
|
134
|
|
- color: Colors.red,
|
135
|
|
- // shape:
|
136
|
|
-
|
137
|
|
- borderRadius: BorderRadius.circular(30),
|
138
|
|
- ),
|
139
|
|
- child: Text(
|
140
|
|
- "Register",
|
141
|
|
- style: TextStyle(fontSize: 22, color: Colors.white),
|
142
|
|
- ),
|
143
|
|
-
|
144
|
|
- )
|
145
|
|
- );
|
146
|
|
- }
|
147
|
|
-
|
148
|
|
- @override
|
149
|
|
- Widget build(BuildContext context) {
|
150
|
|
- final height = MediaQuery.of(context).size.height;
|
151
|
|
- return Scaffold(
|
152
|
|
- body: Container(
|
153
|
|
- height: height,
|
154
|
|
- child:Container(
|
155
|
|
- width: MediaQuery.of(context).size.width,
|
156
|
|
- padding: EdgeInsets.symmetric(horizontal: 20),
|
157
|
|
- // height: MediaQuery.of(context).size.height,
|
158
|
|
- decoration: BoxDecoration(
|
159
|
|
- borderRadius: BorderRadius.all(Radius.circular(4)),
|
160
|
|
- boxShadow: [
|
161
|
|
- BoxShadow(
|
162
|
|
- color: Colors.white,
|
163
|
|
- offset: Offset(0,3),
|
164
|
|
- blurRadius: 5,
|
165
|
|
- spreadRadius: 2)
|
166
|
|
- ]
|
167
|
|
-
|
168
|
|
- ),
|
169
|
|
- child: SingleChildScrollView(
|
170
|
|
- child: Column(
|
171
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
172
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
173
|
|
- children: <Widget> [
|
174
|
|
- SizedBox(
|
175
|
|
- height: 80,
|
176
|
|
- ),
|
177
|
|
- _title(context),
|
178
|
|
- SizedBox(
|
179
|
|
- height: 150,
|
180
|
|
- ),
|
181
|
|
- // _LogInButton(context),
|
182
|
|
- _Fills(),
|
183
|
|
- SizedBox(
|
184
|
|
- height: 60,
|
185
|
|
- ),
|
186
|
|
- _message(context),
|
187
|
|
- SizedBox(
|
188
|
|
- height: 10,
|
189
|
|
- ),
|
190
|
|
- _RegisterButton(context),
|
191
|
|
- SizedBox(
|
192
|
|
- height: 10,
|
193
|
|
- )
|
194
|
|
- ],
|
195
|
|
- )
|
196
|
|
- ),
|
197
|
|
- ),
|
198
|
|
- )
|
199
|
|
- );
|
200
|
|
- }
|
201
|
|
-}
|