Removed Redundant Code
This commit is contained in:
@@ -123,7 +123,6 @@ class _RegisterationPageState extends State<RegisterationPage> {
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
XFile? _imageFile = await MediaService.instance.getImageFromLibrary();
|
||||
_imageFile!.name;
|
||||
setState(() {
|
||||
_image = _imageFile;
|
||||
});
|
||||
@@ -225,18 +224,26 @@ class _RegisterationPageState extends State<RegisterationPage> {
|
||||
width: _deviceWidth,
|
||||
child: MaterialButton(
|
||||
onPressed: () {
|
||||
String name = _name!;
|
||||
if (_image == null) {
|
||||
SnackBarService.instance
|
||||
.showSnackBarError("Please Select Image");
|
||||
}
|
||||
if (_formKey.currentState!.validate() && _image != null) {
|
||||
//
|
||||
_auth.createUser(_email!, _password!, (String _uid) async {
|
||||
var _url = await _auth.uploadUserImage(_image, _uid);
|
||||
_auth.createUserInDB(_uid, _email!, _name!, _url);
|
||||
if (_auth.status == AuthStatus.authenticated) {
|
||||
_auth.loginWithEmailAndPassword(_email!, _password!);
|
||||
}
|
||||
//
|
||||
});
|
||||
//Login User
|
||||
// _auth.loginWithEmailAndPassword(_email!, _password!);
|
||||
_auth.createUser(
|
||||
_email!,
|
||||
_password!,
|
||||
name,
|
||||
(String _uid) async {
|
||||
var _url = await _auth.uploadUserImage(_image, _uid);
|
||||
_auth.createUserInDB(_uid, _email!, name, _url);
|
||||
if (_auth.status == AuthStatus.authenticated) {
|
||||
_auth.loginWithEmailAndPassword(_email!, _password!);
|
||||
}
|
||||
//
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
color: Colors.blue,
|
||||
|
||||
Reference in New Issue
Block a user