readSystemMetrics method
Future<(USystemMetricsResponse?, UEmptyResponse?, String?)>
readSystemMetrics({
- dynamic onOk()?,
- VoidCallback? onError,
- dynamic onException(
- String e
Implementation
Future<(USystemMetricsResponse?, UEmptyResponse?, String?)> readSystemMetrics({
Function(USystemMetricsResponse r)? onOk,
VoidCallback? onError,
Function(String e)? onException,
}) async {
(USystemMetricsResponse?, UEmptyResponse?, String?) result = (null, null, null);
await UHttpClient.send(
method: "POST",
endpoint: "${U.baseUrl}/dashboard/ReadSystemMetrics",
onSuccess: (Response r) {
final USystemMetricsResponse ok = USystemMetricsResponse.fromJson(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;
}