Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Charunirathnayake committed Dec 24, 2019
1 parent e93dc70 commit 556dae4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
10 changes: 7 additions & 3 deletions miniproject/lib/app_screen/Login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class Loginpage_state extends State<Loginpage> {
if(value.isEmpty){
return 'Enter Your Password';
}
else {
return null;
}
},
controller: passcontroller,
obscureText: _isHiddenPw,
Expand Down Expand Up @@ -202,6 +205,7 @@ class Loginpage_state extends State<Loginpage> {
setState(() {
_formkey.currentState.reset();
});
print('Enter your field');
return;
}else{
bool res=await Auth().signInWithEmail(
Expand Down Expand Up @@ -356,13 +360,13 @@ class Image_Facebook extends StatelessWidget {

//validate email
String validateEmail(String value) {
Pattern pattern =
/*Pattern pattern =
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
RegExp regex = new RegExp(pattern);
if (!regex.hasMatch(value)) {
return 'Enter Valid Email';
}
else if(value.isEmpty){
}*/
if(value.isEmpty){
return 'Enter your E mail';
}
return null;
Expand Down
26 changes: 26 additions & 0 deletions miniproject/lib/app_screen/signup.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:miniproject/app_screen/Login.dart';
import 'package:firebase_auth/firebase_auth.dart';

//create appbar
class Signup extends StatelessWidget{
Expand Down Expand Up @@ -31,13 +32,33 @@ class Register_state extends State<Register>{

//validation
var formkey=GlobalKey<FormState>();
UserManagement userObj = new UserManagement();


//controll the editor
TextEditingController FirstController=TextEditingController();
TextEditingController LastController=TextEditingController();
TextEditingController MailController=TextEditingController();
TextEditingController PassController=TextEditingController();

//password visibility icon changing
bool _isHiddenPw = true;
bool _isHiddenCPw = true;

void _visiblePw() {
setState(() {
_isHiddenPw = !_isHiddenPw;
_isHiddenCPw = _isHiddenCPw;
});
}

void _visibleCPw() {
setState(() {
_isHiddenPw = _isHiddenPw;
_isHiddenCPw = !_isHiddenCPw;
});
}

@override
Widget build(BuildContext context) {
return Form(
Expand Down Expand Up @@ -147,6 +168,7 @@ var formkey=GlobalKey<FormState>();
},
controller: FirstController,
decoration: InputDecoration(
errorStyle: TextStyle(color: Color(0xffBA680B), fontSize: 15.0),
labelText: 'First Name',
labelStyle: TextStyle(fontSize: 15.0,color: Colors.black),
hintText: 'Nipun',
Expand Down Expand Up @@ -176,7 +198,9 @@ var formkey=GlobalKey<FormState>();
},
controller: LastController,
decoration: InputDecoration(
errorStyle: TextStyle(color: Color(0xffBA680B), fontSize: 15.0),
hoverColor: Color(0xffBA680B),

labelText: 'Last Name',
labelStyle: TextStyle(fontSize: 15.0,color: Colors.black),
hintText: 'Sachintha',
Expand Down Expand Up @@ -205,6 +229,7 @@ var formkey=GlobalKey<FormState>();

controller: MailController,
decoration: InputDecoration(
errorStyle: TextStyle(color: Color(0xffBA680B), fontSize: 15.0),
labelText: 'E-mail',
labelStyle: TextStyle(fontSize: 15.0,color: Colors.black),
hintText: 'nipunsachintha@gmail.com',
Expand Down Expand Up @@ -233,6 +258,7 @@ var formkey=GlobalKey<FormState>();
controller: PassController,
obscureText: true,
decoration: InputDecoration(
errorStyle: TextStyle(color: Color(0xffBA680B), fontSize: 15.0),
prefixIcon:
Icon(Icons.lock),
suffixIcon:
Expand Down

0 comments on commit 556dae4

Please sign in to comment.