stash 4.0.0-dev.1 copy "stash: ^4.0.0-dev.1" to clipboard
stash: ^4.0.0-dev.1 copied to clipboard

outdated

Stash supports the creation of key/value storages through well defined abstractions which provide plain or cache driven semantics. Supports a wide array of storage backends and integrates with some we [...]

example/example.md

import 'package:stash_memory/stash_memory.dart';

class Task {
  final int id;
  final String title;
  final bool completed;

  Task(this.id, this.title, {this.completed = false});

  @override
  String toString() {
    return 'Task $id: "$title" is ${completed ? "completed" : "not completed"}';
  }
}

void main() async {
  // Creates a memory based cache with a a capacity of 10
  final cache = newMemoryCache(maxEntries: 10);

  // Adds a task with key 'task1' to the cache
  await cache.put(
      'task1', Task(1, 'Run stash_memory example', completed: true));
  // Retrieves the value from the cache
  final value = await cache.get('task1');

  print(value);
}
136
likes
0
pub points
86%
popularity

Publisher

verified publisherivoleitao.dev

Stash supports the creation of key/value storages through well defined abstractions which provide plain or cache driven semantics. Supports a wide array of storage backends and integrates with some well known packages in the dart ecosystem.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

async, clock, equatable, meta, uuid

More

Packages that depend on stash