0 purchases
temp cache
temp_cache #
A package which provides functionality to store objects inside a temporary cache within memory
Getting Started #
Import the package within your pubspec.yaml
temp_cache:
copied to clipboard
Then you can use the classes via importing the lib:
import 'package:temp_cache/temp_cache.dart';
copied to clipboard
Store objects:
var cache = Cache<TestItem>();
final item1 = TestItem('1');
final item2 = TestItem('2');
final item3 = TestItem('3');
cache.put(item1.id, item1);
cache.put(item2.id, item2);
cache.put(item3.id, item3);
// or
final List<TestItem> items = [item1, item2, item3];
cache.putMany(items, (item) => item.id);
copied to clipboard
Get objects:
cache.get('1')
// or
cache.getAll()
copied to clipboard
Buy me a Coffee if you like this package #
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.