Skip to content

Instantly share code, notes, and snippets.

@sbis04
Created September 9, 2020 11:38
Show Gist options
  • Save sbis04/f8b21f83892f9cdcdb213dabef36c8f2 to your computer and use it in GitHub Desktop.
Save sbis04/f8b21f83892f9cdcdb213dabef36c8f2 to your computer and use it in GitHub Desktop.
FlatButton(
color: Colors.blueGrey[800],
hoverColor: Colors.blueGrey[900],
highlightColor: Colors.black,
onPressed: () async {
if (_validateEmail(textControllerEmail.text) == null && _validatePassword(textControllerPassword.text) == null) {
setState(() {
_isRegistering = true;
});
await registerWithEmailPassword(textControllerEmail.text, textControllerPassword.text)
.then((result) {
print(result);
}).catchError((error) {
print('Registration Error: $error');
});
}
setState(() {
_isRegistering = false;
_isEditingEmail = false;
});
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
child: Padding(
padding: EdgeInsets.only(top: 15.0, bottom: 15.0),
child: _isRegistering
? SizedBox(
height: 16,
width: 16,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
)
: Text(
'Sign up',
style: TextStyle(fontSize: 14, color: Colors.white),
),
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment