memory_cache

Creator: coderz1093

Last updated:

Add to Cart

Description:

memory cache

Memory Cache #
Memory Cache is simple, fast and global in-memory cache.
Features #

Create, read, update, delete and invalidate cache.
Expirable Cache
Creating local MemoryCache instance.

Getting started #
Use this package as a Library #

Depend On it
Run this command
with Dart:
$ dart pub add memory_cache
copied to clipboard
with Flutter:
$ flutter pub add memory_cache
copied to clipboard
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get or flutter pub get):
dependencies:
memory_cache: ^1.2.0
copied to clipboard
Usage #
Create New Value #
MemoryCache.instance.create('myKey', 'myValue');
copied to clipboard
with Expiry:
MemoryCache.instance.create(
'myKey',
'myValue',
expiry: const Duration(seconds: 5),
);
copied to clipboard
Read Value #
final myValue = MemoryCache.instance.read<String>('myKey');
copied to clipboard
Update Value #
MemoryCache.instance.update('myKey', 'myUpdatedValue');
copied to clipboard
Delete Value #
MemoryCache.instance.delete('myKey');
copied to clipboard
Local Instance #
MemoryCache can be created locally and same features will be supported
final MemoryCache localCache = MemoryCache();
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.