how to create a button to sign out firebase users influtter code example

Example 1: how to sign out user in flutter with firebase authentication

final FirebaseAuth _auth = FirebaseAuth.instance;

Future _signOut() async {
    await _auth.signOut();
    await _googleSignIn.signOut();
  }

Example 2: sigup and sign out using firebase auth in flutter

Future _signOut() async {
    await _auth.signOut();
    this.setState(() {
      isLoading = false;
    });
    Navigator.of(context).pushAndRemoveUntil(
        MaterialPageRoute(builder: (context) => MyApp()),
        (Route route) => false);
  }

Tags:

Misc Example