logout method

Future<bool> logout()

Implementation

Future<bool> logout() async {
  _setLoading(true);
  final result = await _authService.logout();
  return result.fold(
    (_) {
      _user = null;
      _status = AuthStatus.unauthenticated;
      _setLoading(false);
      return true;
    },
    (error) {
      _setError(error);
      _setLoading(false);
      return false;
    },
  );
}