https://github.com/modulovalue/single_storage_base
Platform agnostic storage interface for Dart.
https://github.com/modulovalue/single_storage_base
Last synced: 10 months ago
JSON representation
Platform agnostic storage interface for Dart.
- Host: GitHub
- URL: https://github.com/modulovalue/single_storage_base
- Owner: modulovalue
- License: mit
- Created: 2019-11-01T11:12:21.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-03T10:31:11.000Z (about 6 years ago)
- Last Synced: 2025-01-21T12:48:10.538Z (12 months ago)
- Language: Dart
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# single_storage_base
[](https://pub.dev/packages/extra_pedantic) [](https://travis-ci.com/modulovalue/single_storage_base) [](https://codecov.io/gh/modulovalue/single_storage_base) [](https://github.com/modulovalue/single_storage_base/blob/master/LICENSE) [](https://pub.dartlang.org/packages/single_storage_base) [](https://github.com/modulovalue/single_storage_base) [](https://twitter.com/modulovalue) [](https://github.com/modulovalue)
Platform agnostic storage interface for Dart.
```dart
class MyStorage extends StorageBase {
@override
Future exists(String key) async {
return false;
}
@override
Future get(String key) async {
return "todo";
}
@override
String location(String key) {
return key;
}
@override
Future remove(String key) async {
// remove
}
@override
Future set(String key, String value) async {
// set
}
}
final storage = MyStorage();
final storageAt = storage.at("somewhere");
final storageSomewhereElse = storage.map((key) => "somewhere/$key");
```