single_item_storage 1.0.0 copy "single_item_storage: ^1.0.0" to clipboard
single_item_storage: ^1.0.0 copied to clipboard

outdated

A single item storage abstraction.

single_item_storage #

A single item storage abstraction with CRUD operations. Use it for testing, easily swapping implementations, and abstracting complex storage implementations.

This package provides a few implementations, but it's intended to be just a base for you to implement and provide specific implementation - file, shared preferences or user defaults, etc. To create your own, implement Storage<E>

Provided implementations:

  • In-memory volatile implementation
  • Cache implementation that wraps another storage implementation and adds caching capabilities. Useful when you have time consuming or performance heavy operations.

Example:

    Storage<String> storage = MemoryStorage<String>();
    
    // add/update item
    await storage.save('item_1');

    // retrieve item
    String? myItem = await itemStore.get();

    // delete item
    await storage.delete();
4
likes
0
pub points
71%
popularity

Publisher

unverified uploader

A single item storage abstraction.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on single_item_storage