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 Promise that resolves with an object containing a key-value map for the requested items, or rejects on failure.

Implementation

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