logout method

Future<void> logout()

Implementation

Future<void> logout() async {
  try {
    await firebaseAuth.signOut();
    await analytics.logEvent(name: 'user_logout');
  } on FirebaseAuthException catch (e) {
    crashlytics.recordError(e, StackTrace.current, reason: 'Auth/logout');

    throw FirebaseFailure(e.message!);
  } catch (e) {
    crashlytics.recordError(e, StackTrace.current, reason: 'Auth/logout');

    throw FirebaseFailure(e.toString());
  }
}