Created
April 9, 2020 07:16
-
-
Save mhmzdev/5a71ebd0975f00367ad17b60f371deff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codeSent() { | |
return (String verificationID, [int forceResendingToken]) { | |
showDialog( | |
context: context, | |
barrierDismissible: false, | |
builder: (context) { | |
return AlertDialog( | |
title: Text('Enter 6-Digit Code'), | |
content: Column( | |
mainAxisSize: MainAxisSize.min, | |
children: <Widget>[ | |
TextField( | |
controller: _controllerCode, | |
keyboardType: TextInputType.number, | |
decoration: InputDecoration( | |
hintText: 'Enter Code', | |
), | |
), | |
Container( | |
height: MediaQuery.of(context).size.height * 0.06, | |
width: MediaQuery.of(context).size.width, | |
child: FlatButton( | |
shape: RoundedRectangleBorder( | |
borderRadius: BorderRadius.circular(5)), | |
child: Text("Confirm"), | |
textColor: Colors.white, | |
color: Colors.lightBlue, | |
onPressed: () async { | |
_auth.currentUser().then((user) { | |
if (user != null) { | |
Navigator.pop(context); | |
Navigator.push( | |
context, | |
MaterialPageRoute( | |
builder: (context) => SecondScreen( | |
user: user, | |
))); | |
} else { | |
_verifyCode(); | |
} | |
}); | |
}, | |
), | |
) | |
], | |
), | |
); | |
}); | |
_verificationId = verificationID; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment