storage_repository 0.0.5 copy "storage_repository: ^0.0.5" to clipboard
storage_repository: ^0.0.5 copied to clipboard

outdated

Abstraction for persisting and reading data to platform specific storage. Best used with dependency injection approach.

Storage repository #

Abstraction for persisting and reading data to platform specific storage.

Usage #

Future  main() async {
    final storageRepository = StorageRepository();
    //Or use like this to support dependency injection
    IStorageRepository concreteStorageRepository = StorageRepository();

    //init must be called
    await storageRepository.init();

    //or like this(if you want to separate storage by some parameter)
    await storageRepository.init(prefix: 'current_user_id');

    storageRepository.set('key', 'dynamic value');

    final value = storageRepository.get('key');

    bool containsKey = storageRepository.containsKey('key');

    storageRepository.delete('key');

    storageRepository.log();

    storageRepository.clear();
}
6
likes
0
pub points
64%
popularity

Publisher

unverified uploader

Abstraction for persisting and reading data to platform specific storage. Best used with dependency injection approach.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, shared_preferences

More

Packages that depend on storage_repository