-
-
Save sbis04/f8b21f83892f9cdcdb213dabef36c8f2 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
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