create static method

Future<Storage> create({
  1. required StorageGet get,
  2. required StorageSet set,
  3. required StorageSetUnchecked setUnchecked,
  4. required StorageRemove remove,
  5. required StorageRemoveUnchecked removeUnchecked,
})

Implementation

static Future<Storage> create({
  required StorageGet get,
  required StorageSet set,
  required StorageSetUnchecked setUnchecked,
  required StorageRemove remove,
  required StorageRemoveUnchecked removeUnchecked,
}) async {
  final instance = Storage._(get, set, setUnchecked, remove, removeUnchecked);

  final lib = createLib();
  instance.storage = await lib.newStaticMethodStorageDartWrapper(
    instanceHash: instance.instanceHash,
  );

  return instance;
}