temp_cache 0.0.7 copy "temp_cache: ^0.0.7" to clipboard
temp_cache: ^0.0.7 copied to clipboard

A package which provides functionality to store objects inside a temporary cache inside memory

example/main.dart

import 'package:temp_cache/cache.dart';

void main(List<String> args) {
  final cache = Cache<TestItem>();
  final item1 = TestItem('1');
  final item2 = TestItem('2');
  final item3 = TestItem('3');

  // put one
  cache.put(item1.id, item1);

  // put many
  final List<TestItem> items = [item2, item3];
  cache.putMany(items, (item) => item.id);

  // get one
  // ignore: unused_local_variable
  final i1 = cache.get('1');

  // get all
  // ignore: unused_local_variable
  final retrievedList = cache.getAll();
}

class TestItem {
  late final String id;
  late final bool isTrue;

  TestItem(this.id);
}
1
likes
160
points
205
downloads

Publisher

verified publisherzooper.dev

Weekly Downloads

A package which provides functionality to store objects inside a temporary cache inside memory

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, flutter

More

Packages that depend on temp_cache