signOut method

  1. @override
Future<void> signOut()
override

Signs out the logged in user

Implementation

@override
Future<void> signOut() async {
  try {
    final result = await _amplifyAuth.signOut();
    _logger.fine('Successfully signed out: $result');

    // notify listeners of user stream by adding an empty
    // User instance to the user stream controller
    _enqueueEvent(const LoggedOutEvent());
  } on aws_cognito.AuthException catch (e, stackTrace) {
    throw SignOutException(
      message: 'Failed to sign out user',
      innerException: e,
      innerStackTrace: stackTrace,
    );
  }
}