single_storage_base

extra_pedantic on pub.dev Travis CI Codecov License Pub.dev Github Stars Twitter Follow GitHub Follow

Platform agnostic storage interface for Dart.

class MyStorage extends StorageBase<String> {
  @override
  Future<bool> exists(String key) async {
    return false;
  }

  @override
  Future<String> get(String key) async {
    return "todo";
  }

  @override
  String location(String key) {
    return key;
  }

  @override
  Future<void> remove(String key) async {
    // remove
  }

  @override
  Future<void> set(String key, String value) async {
    // set
  }
}

final storage = MyStorage();
final storageAt = storage.at("somewhere");
final storageSomewhereElse = storage.map((key) => "somewhere/$key");

Libraries

single_storage_base