get method

Future<Map> get(
  1. Object? keys
)

Gets one or more items from storage. keys A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in null to get the entire contents of storage. returns Callback with storage items, or on failure (in which case runtime.lastError will be set).

Implementation

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