signOut static method

Future<void> signOut({
  1. required BuildContext context,
})

Implementation

static Future<void> signOut({required BuildContext context}) async {
  final GoogleSignIn googleSignIn = GoogleSignIn();

  try {
    if (!kIsWeb) {
      await googleSignIn.signOut();
    }
    await FirebaseAuth.instance.signOut();
  } catch (e) {
    ScaffoldMessenger.of(context).showSnackBar(
      Authentication.customSnackBar(
        content: 'Error signing out. Try again.',
      ),
    );
  }
}