fetchCurrentUser method

  1. @override
Future<User> fetchCurrentUser()
override

Fetches the current user.

Implementation

@override
Future<User> fetchCurrentUser() async {
  var response = await apiService.callFunction(
    function: "local_lbplanner_user_get_user",
    token: userToken.lbPlannerApiToken,
    body: {},
  );

  if (response.failed) {
    throw Exception("Failed to fetch current user");
  }

  return User.fromJson(response.expectSingle());
}