londonappbrewery / Flash-Chat-Flutter-Complete

The completed code for the Flash Chat Project - The Complete Flutter Development Bootcamp
https://www.appbrewery.co/
92 stars 133 forks source link

The spinner showing for a long time after the wrong credential submitted in #2

Open iskandarzhilmi opened 4 years ago

iskandarzhilmi commented 4 years ago

I've fixed it by writing the setState outsite of the try catch

Raj-kar commented 4 years ago

Use This code:-

` try { final newUser = await _auth.signInWithEmailAndPassword( email: email, password: password);

                  if (newUser != null) {
                    Navigator.pushReplacementNamed(context, ChatScreen.id);
                  }
                } catch (e) {
                  setState(() {
                    showSpinner = false;
                  });
                  print(e);
                }`