SMBI Developer
SMBI Developer

Reputation: 11

How to display a custom alert dialog in Flutter based on Firebase Auth error message?

How to display a custom alert dialog based on an error message from Firebase Auth in Flutter. Let's say if a user submitted incorrect email or password or even user's email already registered on firebase then it will pop up an alert dialog based on it's error. Thank you in advanced

Upvotes: 1

Views: 811

Answers (1)

Omer Gamliel
Omer Gamliel

Reputation: 506

You can call showDialog method inside catch

  catch (e) {
          print(e);
          showDialog(
          context: context,
          builder: (context) {
            return AlertDialog(
            // set your custom alert dialog here 
            );
          });
  }

Upvotes: 1

Related Questions