update
This commit is contained in:
parent
3aa12bfcad
commit
71a289b74c
11 changed files with 108 additions and 52 deletions
|
|
@ -31,8 +31,6 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
final password = _passwordController.text;
|
||||
final confirmPassword = _confirmPasswordController.text;
|
||||
|
||||
setState(() => _isLoading = true);
|
||||
|
||||
if (email.isEmpty) {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: Please enter a valid email', false);
|
||||
|
|
@ -59,9 +57,21 @@ class _RegisterPageState extends State<RegisterPage> {
|
|||
return;
|
||||
}
|
||||
|
||||
setState(() => _isLoading = true);
|
||||
|
||||
try {
|
||||
if (await InternetConnectionChecker.instance.hasConnection) {
|
||||
await _authService.signUp(email, password);
|
||||
|
||||
if (mounted) {
|
||||
showNotification(context, 'Registration Successful', true);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) {
|
||||
context.push('/login');
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (mounted) {
|
||||
showNotification(context, 'Error: No Internet Connection', false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue