Skip to content

Commit 59b3724

Browse files
committed
first commit
1 parent dc9a247 commit 59b3724

File tree

6 files changed

+96
-274
lines changed

6 files changed

+96
-274
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "automatic"
3+
}

android/app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ apply plugin: 'kotlin-android'
2727
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2828

2929
android {
30-
compileSdkVersion flutter.compileSdkVersion
30+
compileSdkVersion 31
3131
ndkVersion flutter.ndkVersion
3232

3333
compileOptions {
@@ -48,10 +48,11 @@ android {
4848
applicationId "com.example.login_page"
4949
// You can update the following values to match your application needs.
5050
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
51-
minSdkVersion 21
51+
minSdkVersion 19
5252
targetSdkVersion 30
5353
versionCode flutterVersionCode.toInteger()
5454
versionName flutterVersionName
55+
multiDexEnabled true
5556
}
5657

5758
buildTypes {

lib/authentication/signin/screens/signin_screen.dart

Lines changed: 7 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -16,108 +16,24 @@ class LoginScreen extends StatefulWidget {
1616
}
1717

1818
class _LoginScreenState extends State<LoginScreen> {
19-
// form key
19+
// form key
2020
final _formKey = GlobalKey<FormState>();
2121

22-
// editing controller
22+
// text controller
2323

24-
final TextEditingController _emailController = TextEditingController();
25-
final TextEditingController _passwordController = TextEditingController();
24+
final _emailController = TextEditingController();
25+
final _passwordController = TextEditingController();
2626

27-
// firebase
27+
// firebase
2828

2929
final _auth = FirebaseAuth.instance;
3030

31-
// string for displaying the error Message
31+
// string for displaying the error Message
3232

3333
String? errorMessage;
3434

3535
@override
3636
Widget build(BuildContext context) {
37-
//email field
38-
39-
// final emailField = TextFormField(
40-
// autofocus: false,
41-
// controller: _emailController,
42-
// keyboardType: TextInputType.emailAddress,
43-
// validator: (value) {
44-
// if (value!.isEmpty) {
45-
// return ("Please Enter Your Email");
46-
// }
47-
48-
// if (!RegExp("^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-z]").hasMatch(value)) {
49-
// return ("Please Enter a valid email");
50-
// }
51-
// return null;
52-
// },
53-
// onSaved: (value) {
54-
// _emailController.text = value!;
55-
// },
56-
// textInputAction: TextInputAction.next,
57-
// decoration: InputDecoration(
58-
// prefixIcon: const Icon(Icons.mail),
59-
// contentPadding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
60-
// hintText: "Email",
61-
// border: OutlineInputBorder(
62-
// borderRadius: BorderRadius.circular(10),
63-
// ),
64-
// ),
65-
// );
66-
67-
//password field
68-
69-
// final passwordField = TextFormField(
70-
// autofocus: false,
71-
// controller: _passwordController,
72-
// obscureText: true,
73-
// validator: (value) {
74-
// RegExp regex = new RegExp(r'^.{6,}$');
75-
// if (value!.isEmpty) {
76-
// return ("Password is required for login");
77-
// }
78-
// if (!regex.hasMatch(value)) {
79-
// return ("Enter Valid Password(Min. 6 Character)");
80-
// }
81-
// return null;
82-
// },
83-
// onSaved: (value) {
84-
// _passwordController.text = value!;
85-
// },
86-
// textInputAction: TextInputAction.done,
87-
// decoration: InputDecoration(
88-
// prefixIcon: const Icon(Icons.vpn_key),
89-
// contentPadding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
90-
// hintText: "Password",
91-
// border: OutlineInputBorder(
92-
// borderRadius: BorderRadius.circular(10),
93-
// ),
94-
// ),
95-
// );
96-
97-
// button field
98-
99-
// final loginButton = Material(
100-
// elevation: 5,
101-
// borderRadius: BorderRadius.circular(30),
102-
// color: Colors.redAccent,
103-
// child: MaterialButton(
104-
// padding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
105-
// minWidth: MediaQuery.of(context).size.width,
106-
// onPressed: () {
107-
// signIn(emailController.text, passwordController.text);
108-
// },
109-
// child: const Text(
110-
// "Login",
111-
// textAlign: TextAlign.center,
112-
// style: TextStyle(
113-
// fontSize: 20,
114-
// color: Colors.white,
115-
// fontWeight: FontWeight.bold,
116-
// ),
117-
// ),
118-
// ),
119-
// );
120-
12137
return Scaffold(
12238
backgroundColor: Colors.white,
12339
body: Center(
@@ -150,7 +66,7 @@ class _LoginScreenState extends State<LoginScreen> {
15066
return ("Please Enter Your Email");
15167
}
15268

153-
if (!RegExp("^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-z]")
69+
if (!RegExp(r"^[a-zA-Z0-9.]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
15470
.hasMatch(value)) {
15571
return ("Please Enter a valid email");
15672
}

lib/authentication/signup/screens/signup_screen.dart

Lines changed: 10 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -17,197 +17,28 @@ class RegistrationScreen extends StatefulWidget {
1717
}
1818

1919
class _RegistrationScreenState extends State<RegistrationScreen> {
20-
// firebase
20+
// firebase
2121

2222
final _auth = FirebaseAuth.instance;
2323

24-
// string for displaying the error Message
24+
// string for displaying the error Message
2525

2626
String? errorMessage;
2727

28-
// our form key
28+
// our form key
2929

3030
final _formKey = GlobalKey<FormState>();
3131

32-
// editing Controller
32+
// text controller
3333

34-
final TextEditingController _firstNameController = TextEditingController();
35-
final TextEditingController _secondNameController = TextEditingController();
36-
final TextEditingController _emailController = TextEditingController();
37-
final TextEditingController _passwordController = TextEditingController();
38-
final TextEditingController _confirmPasswordController =
39-
TextEditingController();
34+
final _firstNameController = TextEditingController();
35+
final _secondNameController = TextEditingController();
36+
final _emailController = TextEditingController();
37+
final _passwordController = TextEditingController();
38+
final _confirmPasswordController = TextEditingController();
4039

4140
@override
4241
Widget build(BuildContext context) {
43-
//first name field
44-
45-
// final firstNameField = TextFormField(
46-
// autofocus: false,
47-
// controller: _firstNameController,
48-
// keyboardType: TextInputType.name,
49-
// validator: (value) {
50-
// RegExp regex = RegExp(r'^.{3,}$');
51-
// if (value!.isEmpty) {
52-
// return ("First Name cannot be Empty");
53-
// }
54-
// if (!regex.hasMatch(value)) {
55-
// return ("Enter Valid name(Min. 3 Character)");
56-
// }
57-
// return null;
58-
// },
59-
// onSaved: (value) {
60-
// _firstNameController.text = value!;
61-
// },
62-
// textInputAction: TextInputAction.next,
63-
// decoration: InputDecoration(
64-
// prefixIcon: const Icon(Icons.account_circle),
65-
// contentPadding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
66-
// hintText: "First Name",
67-
// border: OutlineInputBorder(
68-
// borderRadius: BorderRadius.circular(10),
69-
// ),
70-
// ),
71-
// );
72-
73-
//second name field
74-
75-
// final secondNameField = TextFormField(
76-
// autofocus: false,
77-
// controller: _secondNameController,
78-
// keyboardType: TextInputType.name,
79-
// validator: (value) {
80-
// if (value!.isEmpty) {
81-
// return ("Second Name cannot be Empty");
82-
// }
83-
// return null;
84-
// },
85-
// onSaved: (value) {
86-
// _secondNameController.text = value!;
87-
// },
88-
// textInputAction: TextInputAction.next,
89-
// decoration: InputDecoration(
90-
// prefixIcon: const Icon(Icons.account_circle),
91-
// contentPadding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
92-
// hintText: "Second Name",
93-
// border: OutlineInputBorder(
94-
// borderRadius: BorderRadius.circular(10),
95-
// ),
96-
// ),
97-
// );
98-
99-
//email field
100-
101-
// final emailField = TextFormField(
102-
// autofocus: false,
103-
// controller: _emailController,
104-
// keyboardType: TextInputType.emailAddress,
105-
// validator: (value) {
106-
// if (value!.isEmpty) {
107-
// return ("Please Enter Your Email");
108-
// }
109-
// if (!RegExp("^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-z]").hasMatch(value)) {
110-
// return ("Please Enter a valid email");
111-
// }
112-
// return null;
113-
// },
114-
// onSaved: (value) {
115-
// _emailController.text = value!;
116-
// },
117-
// textInputAction: TextInputAction.next,
118-
// decoration: InputDecoration(
119-
// prefixIcon: const Icon(Icons.mail),
120-
// contentPadding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
121-
// hintText: "Email",
122-
// border: OutlineInputBorder(
123-
// borderRadius: BorderRadius.circular(10),
124-
// ),
125-
// ),
126-
// );
127-
128-
//password field
129-
130-
// final passwordField = TextFormField(
131-
// autofocus: false,
132-
// controller: _passwordController,
133-
// obscureText: true,
134-
// validator: (value) {
135-
// RegExp regex = RegExp(r'^.{6,}$');
136-
// if (value!.isEmpty) {
137-
// return ("Password is required for login");
138-
// }
139-
// if (!regex.hasMatch(value)) {
140-
// return ("Enter Valid Password(Min. 6 Character)");
141-
// }
142-
// return null;
143-
// },
144-
// onSaved: (value) {
145-
// _passwordController.text = value!;
146-
// },
147-
// textInputAction: TextInputAction.next,
148-
// decoration: InputDecoration(
149-
// prefixIcon: const Icon(Icons.vpn_key),
150-
// contentPadding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
151-
// hintText: "Password",
152-
// border: OutlineInputBorder(
153-
// borderRadius: BorderRadius.circular(10),
154-
// ),
155-
// ),
156-
// );
157-
158-
//confirm password field
159-
160-
// final confirmPasswordField = TextFormField(
161-
// autofocus: false,
162-
// controller: _confirmPasswordController,
163-
// obscureText: true,
164-
// validator: (value) {
165-
// if (_confirmPasswordController.text != _passwordController.text) {
166-
// return "Password don't match";
167-
// }
168-
// return null;
169-
// },
170-
// onSaved: (value) {
171-
// _confirmPasswordController.text = value!;
172-
// },
173-
// textInputAction: TextInputAction.done,
174-
// decoration: InputDecoration(
175-
// prefixIcon: const Icon(Icons.vpn_key),
176-
// contentPadding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
177-
// hintText: "Confirm Password",
178-
// border: OutlineInputBorder(
179-
// borderRadius: BorderRadius.circular(10),
180-
// ),
181-
// ),
182-
// );
183-
184-
//signup button
185-
186-
// final signUpButton = Material(
187-
// elevation: 5,
188-
// borderRadius: BorderRadius.circular(30),
189-
// color: Colors.redAccent,
190-
// child: MaterialButton(
191-
// padding: const EdgeInsets.fromLTRB(20, 15, 20, 15),
192-
// minWidth: MediaQuery.of(context).size.width,
193-
// onPressed: () {
194-
// signUp(
195-
// emailEditingController.text,
196-
// passwordEditingController.text,
197-
// );
198-
// },
199-
// child: const Text(
200-
// "SignUp",
201-
// textAlign: TextAlign.center,
202-
// style: TextStyle(
203-
// fontSize: 20,
204-
// color: Colors.white,
205-
// fontWeight: FontWeight.bold,
206-
// ),
207-
// ),
208-
// ),
209-
// );
210-
21142
return Scaffold(
21243
backgroundColor: Colors.white,
21344
appBar: AppBar(
@@ -294,7 +125,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
294125
if (value!.isEmpty) {
295126
return ("Please Enter Your Email");
296127
}
297-
if (!RegExp("^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+.[a-z]")
128+
if (!RegExp(r"^[a-zA-Z0-9.]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
298129
.hasMatch(value)) {
299130
return ("Please Enter a valid email");
300131
}

0 commit comments

Comments
 (0)