1
- // ignore_for_file: unnecessary_new, library_private_types_in_public_api
1
+ // ignore_for_file: unnecessary_new, avoid_print
2
2
3
3
import 'package:cloud_firestore/cloud_firestore.dart' ;
4
- import '/model/user_model.dart' ;
5
- import '/screens/home_screen.dart' ;
6
4
import 'package:firebase_auth/firebase_auth.dart' ;
7
5
import 'package:flutter/material.dart' ;
8
6
import 'package:fluttertoast/fluttertoast.dart' ;
7
+ import '/model/user_model.dart' ;
8
+ import '/screens/home_screen.dart' ;
9
9
10
10
class RegistrationScreen extends StatefulWidget {
11
11
const RegistrationScreen ({Key ? key}) : super (key: key);
12
12
13
13
@override
14
- _RegistrationScreenState createState () => _RegistrationScreenState ();
14
+ State < RegistrationScreen > createState () => _RegistrationScreenState ();
15
15
}
16
16
17
17
class _RegistrationScreenState extends State <RegistrationScreen > {
@@ -58,8 +58,8 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
58
58
},
59
59
textInputAction: TextInputAction .next,
60
60
decoration: InputDecoration (
61
- prefixIcon: Icon (Icons .account_circle),
62
- contentPadding: EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
61
+ prefixIcon: const Icon (Icons .account_circle),
62
+ contentPadding: const EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
63
63
hintText: "First Name" ,
64
64
border: OutlineInputBorder (
65
65
borderRadius: BorderRadius .circular (10 ),
@@ -84,8 +84,8 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
84
84
},
85
85
textInputAction: TextInputAction .next,
86
86
decoration: InputDecoration (
87
- prefixIcon: Icon (Icons .account_circle),
88
- contentPadding: EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
87
+ prefixIcon: const Icon (Icons .account_circle),
88
+ contentPadding: const EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
89
89
hintText: "Second Name" ,
90
90
border: OutlineInputBorder (
91
91
borderRadius: BorderRadius .circular (10 ),
@@ -113,8 +113,8 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
113
113
},
114
114
textInputAction: TextInputAction .next,
115
115
decoration: InputDecoration (
116
- prefixIcon: Icon (Icons .mail),
117
- contentPadding: EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
116
+ prefixIcon: const Icon (Icons .mail),
117
+ contentPadding: const EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
118
118
hintText: "Email" ,
119
119
border: OutlineInputBorder (
120
120
borderRadius: BorderRadius .circular (10 ),
@@ -143,8 +143,8 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
143
143
},
144
144
textInputAction: TextInputAction .next,
145
145
decoration: InputDecoration (
146
- prefixIcon: Icon (Icons .vpn_key),
147
- contentPadding: EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
146
+ prefixIcon: const Icon (Icons .vpn_key),
147
+ contentPadding: const EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
148
148
hintText: "Password" ,
149
149
border: OutlineInputBorder (
150
150
borderRadius: BorderRadius .circular (10 ),
@@ -170,8 +170,8 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
170
170
},
171
171
textInputAction: TextInputAction .done,
172
172
decoration: InputDecoration (
173
- prefixIcon: Icon (Icons .vpn_key),
174
- contentPadding: EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
173
+ prefixIcon: const Icon (Icons .vpn_key),
174
+ contentPadding: const EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
175
175
hintText: "Confirm Password" ,
176
176
border: OutlineInputBorder (
177
177
borderRadius: BorderRadius .circular (10 ),
@@ -186,12 +186,15 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
186
186
borderRadius: BorderRadius .circular (30 ),
187
187
color: Colors .redAccent,
188
188
child: MaterialButton (
189
- padding: EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
189
+ padding: const EdgeInsets .fromLTRB (20 , 15 , 20 , 15 ),
190
190
minWidth: MediaQuery .of (context).size.width,
191
191
onPressed: () {
192
- signUp (emailEditingController.text, passwordEditingController.text);
192
+ signUp (
193
+ emailEditingController.text,
194
+ passwordEditingController.text,
195
+ );
193
196
},
194
- child: Text (
197
+ child: const Text (
195
198
"SignUp" ,
196
199
textAlign: TextAlign .center,
197
200
style: TextStyle (
@@ -209,7 +212,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
209
212
elevation: 0 ,
210
213
backgroundColor: Colors .transparent,
211
214
leading: IconButton (
212
- icon: Icon (
215
+ icon: const Icon (
213
216
Icons .arrow_back,
214
217
color: Colors .red,
215
218
),
@@ -223,7 +226,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
223
226
child: Container (
224
227
color: Colors .white,
225
228
child: Padding (
226
- padding: EdgeInsets .all (36.0 ),
229
+ padding: const EdgeInsets .all (36.0 ),
227
230
child: Form (
228
231
key: _formKey,
229
232
child: Column (
@@ -237,33 +240,19 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
237
240
fit: BoxFit .contain,
238
241
),
239
242
),
240
- SizedBox (
241
- height: 45 ,
242
- ),
243
+ const SizedBox (height: 45 ),
243
244
firstNameField,
244
- SizedBox (
245
- height: 20 ,
246
- ),
245
+ const SizedBox (height: 20 ),
247
246
secondNameField,
248
- SizedBox (
249
- height: 20 ,
250
- ),
247
+ const SizedBox (height: 20 ),
251
248
emailField,
252
- SizedBox (
253
- height: 20 ,
254
- ),
249
+ const SizedBox (height: 20 ),
255
250
passwordField,
256
- SizedBox (
257
- height: 20 ,
258
- ),
251
+ const SizedBox (height: 20 ),
259
252
confirmPasswordField,
260
- SizedBox (
261
- height: 20 ,
262
- ),
253
+ const SizedBox (height: 20 ),
263
254
signUpButton,
264
- SizedBox (
265
- height: 15 ,
266
- ),
255
+ const SizedBox (height: 15 ),
267
256
],
268
257
),
269
258
),
@@ -342,7 +331,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
342
331
Navigator .pushAndRemoveUntil (
343
332
(context),
344
333
MaterialPageRoute (
345
- builder: (context) => HomeScreen (),
334
+ builder: (context) => const HomeScreen (),
346
335
),
347
336
(route) => false );
348
337
}
0 commit comments