costs static method

Future<UApiCallCosts?> costs()

Implementation

static Future<UApiCallCosts?> costs() async {
  if (_costs != null) return _costs;
  final Completer<UApiCallCosts?> completer = Completer<UApiCallCosts?>();
  await UServices.appSettings.read(
    p: UAppSettingsReadParams(),
    onOk: (UResponse<UAppSettingsResponse> r) {
      _costs = r.result?.apiCallCosts;
      completer.complete(_costs);
    },
    onError: (UEmptyResponse e) => completer.complete(null),
    onException: (String e) => completer.complete(null),
  );
  return completer.future;
}