Skip to content

Instantly share code, notes, and snippets.

@mhmzdev
Created April 9, 2020 07:16
Show Gist options
  • Save mhmzdev/5a71ebd0975f00367ad17b60f371deff to your computer and use it in GitHub Desktop.
Save mhmzdev/5a71ebd0975f00367ad17b60f371deff to your computer and use it in GitHub Desktop.
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