getBytesInUse method

Future<double> getBytesInUse(
  1. Object? keys
)

Gets the amount of space (in bytes) being used by one or more items. keys A single key or list of keys to get the total usage for. An empty list will return 0. Pass in null to get the total usage of all of storage. returns Callback with the amount of space being used by storage, or on failure (in which case runtime.lastError will be set).

Implementation

Future<double> getBytesInUse(Object? keys) async {
  var $res =
      await promiseToFuture<double>(_wrapped.getBytesInUse(switch (keys) {
    String() => keys.jsify()!,
    List() => keys.toJSArrayString(),
    null => null,
    _ => throw UnsupportedError(
        'Received type: ${keys.runtimeType}. Supported types are: String, List<String>')
  }));
  return $res;
}