getLogContent method
Future<(String?, UEmptyResponse?, String?)>
getLogContent({
- required String logId,
- required dynamic onOk(
- String e
- required VoidCallback? onError,
- required dynamic onException(
- String e
Implementation
Future<(String?, UEmptyResponse?, String?)> getLogContent({
required String logId,
required Function(String r)? onOk,
required VoidCallback? onError,
required Function(String e)? onException,
}) async {
(String?, UEmptyResponse?, String?) result = (null, null, null);
await UHttpClient.send(
method: "POST",
endpoint: "${U.baseUrl}/dashboard/Logs/content",
body: <String, String>{"id": logId},
onSuccess: (Response r) {
final String ok = r.body;
result = (ok, null, null);
onOk?.call(ok);
},
onError: (Response r) {
final UEmptyResponse err = UEmptyResponse.fromJson(r.body);
result = (null, err, null);
onError?.call();
},
onException: (String e) {
result = (null, null, e);
onException?.call(e);
},
);
return result;
}