getCacheUser method

Future<KimikoResponse> getCacheUser()

Implementation

Future<KimikoResponse> getCacheUser() async {
  try {
    Map<String, dynamic>? user = await storageService.getUser();
    if (user != null) {
      return KimikoResponse(data: user);
    } else {
      throw {
        "error":  "User not saved"
      };
    }
  } on DioException catch (e) {
    throw {
      "error": e.response?.data ?? e.error.toString() ?? "Failed to get user"
    };
  }
}