clearAppLogs method

Future<(bool, UEmptyResponse?, String?)> clearAppLogs({
  1. required VoidCallback? onOk,
  2. dynamic onError(
    1. UEmptyResponse e
    )?,
  3. dynamic onException(
    1. String e
    )?,
})

Implementation

Future<(bool, UEmptyResponse?, String?)> clearAppLogs({
  required VoidCallback? onOk,
  Function(UEmptyResponse e)? onError,
  Function(String e)? onException,
}) async {
  (bool, UEmptyResponse?, String?) result = (false, null, null);
  await UHttpClient.send(
    method: "DELETE",
    endpoint: "${U.baseUrl}/Log/Clear",
    onSuccess: (Response r) {
      result = (true, null, null);
      onOk?.call();
    },
    onError: (Response r) {
      final UEmptyResponse err = UEmptyResponse.fromJson(r.body);
      result = (false, err, null);
      onError?.call(err);
    },
    onException: (String e) {
      result = (false, null, e);
      onException?.call(e);
    },
  );
  return result;
}