@@ -40,7 +40,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
4040 ),
4141 // The validator receives the text that the user has entered.
4242 validator: (value) {
43- if (value.isEmpty) {
43+ if (value! .isEmpty) {
4444 return 'Enter User Name' ;
4545 }
4646 return null ;
@@ -59,7 +59,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
5959 ),
6060 // The validator receives the text that the user has entered.
6161 validator: (value) {
62- if (value.isEmpty) {
62+ if (value! .isEmpty) {
6363 return 'Enter an Email Address' ;
6464 } else if (! value.contains ('@' )) {
6565 return 'Please enter a valid email address' ;
@@ -80,7 +80,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
8080 ),
8181 // The validator receives the text that the user has entered.
8282 validator: (value) {
83- if (value.isEmpty) {
83+ if (value! .isEmpty) {
8484 return 'Enter Age' ;
8585 }
8686 return null ;
@@ -100,7 +100,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
100100 ),
101101 // The validator receives the text that the user has entered.
102102 validator: (value) {
103- if (value.isEmpty) {
103+ if (value! .isEmpty) {
104104 return 'Enter Password' ;
105105 } else if (value.length < 6 ) {
106106 return 'Password must be atleast 6 characters!' ;
@@ -116,7 +116,7 @@ class _EmailSignUpState extends State<EmailSignUp> {
116116 : ElevatedButton (
117117 style: ButtonStyle (backgroundColor: MaterialStateProperty .all <Color >(Colors .lightBlue)),
118118 onPressed: () {
119- if (_formKey.currentState.validate ()) {
119+ if (_formKey.currentState! .validate ()) {
120120 setState (() {
121121 isLoading = true ;
122122 });
@@ -134,15 +134,15 @@ class _EmailSignUpState extends State<EmailSignUp> {
134134 .createUserWithEmailAndPassword (
135135 email: emailController.text, password: passwordController.text)
136136 .then ((result) {
137- dbRef.child (result.user.uid).set ({
137+ dbRef.child (result.user! .uid).set ({
138138 "email" : emailController.text,
139139 "age" : ageController.text,
140140 "name" : nameController.text
141141 }).then ((res) {
142142 isLoading = false ;
143143 Navigator .pushReplacement (
144144 context,
145- MaterialPageRoute (builder: (context) => Home (uid: result.user.uid)),
145+ MaterialPageRoute (builder: (context) => Home (uid: result.user! .uid)),
146146 );
147147 });
148148 }).catchError ((err) {
0 commit comments