https://github.com/myconsciousness/cache-storage
A most easily usable cache management library in Dart. With CacheStorage, you can easily manage cache on your application.
https://github.com/myconsciousness/cache-storage
cache cache-storage cachemanager dart flutter library pubdev
Last synced: 2 months ago
JSON representation
A most easily usable cache management library in Dart. With CacheStorage, you can easily manage cache on your application.
- Host: GitHub
- URL: https://github.com/myconsciousness/cache-storage
- Owner: myConsciousness
- License: bsd-3-clause
- Created: 2021-12-12T09:04:28.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-13T00:19:30.000Z (almost 4 years ago)
- Last Synced: 2024-10-19T10:00:37.047Z (12 months ago)
- Topics: cache, cache-storage, cachemanager, dart, flutter, library, pubdev
- Language: Dart
- Homepage: https://pub.dev/packages/cache_storage
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
**_A most easily usable cache management library in Dart!_**
[](https://pub.dev/packages/cache_storage)
[](https://codecov.io/gh/myConsciousness/cache-storage)
[](https://github.com/myConsciousness/cache-storage/actions/workflows/analyzer.yml)
[](https://github.com/myConsciousness/cache-storage/actions/workflows/test.yml)- [1. About](#1-about)
- [1.1. Introduction](#11-introduction)
- [1.1.1. Install Library](#111-install-library)
- [1.1.2. Import It](#112-import-it)
- [1.1.3. Use CacheStorage](#113-use-cachestorage)
- [1.2. License](#12-license)
- [1.3. More Information](#13-more-information)# 1. About
`CacheStorage` is an open-sourced Dart library.
With `CacheStorage`, you can easily manage cache on your application.Caching in `CacheStorage` manages value with a string key and subkeys consisting of multiple strings. The cache value can be of any type, so it can be used for various use cases.
With `CacheStorage`, redundant implementations of cache management are no longer necessary!
## 1.1. Introduction
### 1.1.1. Install Library
**_With Dart:_**
```terminal
dart pub add cache_storage
```**_With Flutter:_**
```terminal
flutter pub add cache_storage
```### 1.1.2. Import It
```dart
import 'package:cache_storage/cache_storage.dart';
```### 1.1.3. Use CacheStorage
```dart
import 'package:cache_storage/cache_storage.dart';void main() {
// Get singleton instance of cache storage.
final cacheStorage = CacheStorage.open();// You can save any objects with key.
cacheStorage.save(
key: 'testKey',
value: ['spmething1', 'something2'],
);// Also you can save any objects with key and sub keys.
cacheStorage.save(
key: 'testKey',
subKeys: ['key1', 'key2'],
value: 'something',
);// It returns value 'something' linked to key and sub keys.
cacheStorage.match(key: 'testKey', subKeys: ['key1', 'key2']);// You can delete cache by key and sub keys.
cacheStorage.deleteBy(key: 'testKey', subKeys: ['key1', 'key2']);
// You can delete all at the same time.
cacheStorage.delete();// You can check storage has cache linked to
// key and sub keys or not.
if (cacheStorage.has(key: 'testKey')) {
// Do something.
}
}
```## 1.2. License
```license
Copyright (c) 2021, Kato Shinya. All rights reserved.
Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file.
```## 1.3. More Information
`CacheStorage` was designed and implemented by **_Kato Shinya_**.
- [Creator Profile](https://github.com/myConsciousness)
- [License](https://github.com/myConsciousness/cache-storage/blob/main/LICENSE)
- [API Document](https://pub.dev/documentation/cache_storage/latest/cache_storage/cache_storage-library.html)
- [Release Note](https://github.com/myConsciousness/cache-storage/releases)
- [Bug Report](https://github.com/myConsciousness/cache-storage/issues)