ivoleitao / stash

Key-value store abstraction with plain and cache driven semantics and a pluggable backend architecture.
MIT License
87 stars 16 forks source link

Not a bug, but a question #25

Closed ElixirMike closed 2 years ago

ElixirMike commented 2 years ago

I'm new to this, so forgive the simplicity of the question. Once you create the memory cache in your main.dart, how do you import the same cache in other files to use/leverage the cache?

ivoleitao commented 2 years ago

I don't have flutter example (I plan to add one at some point) but you need to maintain a singleton in your app probably leveraging a state management solution like bloc, provider (and the countless others). I'll probably use bloc to create an example but it's just a matter of personal taste