loadProfile method

Future<void> loadProfile()

Implementation

Future<void> loadProfile() async {
  state = state.copyWith(isLoading: true);
  try {
    final user = await _service.getMe();
    state = state.copyWith(user: user, isLoading: false);
  } catch (e) {
    state = state.copyWith(isLoading: false, error: e.toString());
  }
}