plain_cache 1.0.0 copy "plain_cache: ^1.0.0" to clipboard
plain_cache: ^1.0.0 copied to clipboard

outdated

Persistent cache library for Dart(Flutter for iOS and Android).

simple_cache #

Persistent cache library for Dart(Flutter for iOS and Android).

Usage #

Enable Simple Cache #

import 'package:simple_cache/simple_cache.dart';

void main() {
  // Enable Simple Cache
  SimpleCache.enable();

  runApp(MyApp());
}

simple usage example: #

Save to persistent cache / 保存数据到持久性缓存

 storage.setValue('newValue', forKey: 'MyKey');

Read from persistent cache / 从持久性缓存中读取数据

final boolValue = storage.getBool(forKey: 'MyKey');
final doubleValue = storage.getDouble(forKey: 'MyKey');
final intValue = storage.getInt(forKey: 'MyKey');
final listValue = storage.getList(forKey: 'MyKey');
final mapValue = storage.getMap(forKey: 'MyKey');
final stringValue = storage.getString(forKey: 'MyKey');

Remove from persistent cache / 从持久性缓存中删除数据

storage.remove(forKey: 'MyKey');

License / 许可证 #

simple_cache is released under the MIT license. See LICENSE for details.

simple_cache 是在 MIT 许可下发布的,有关详情请查看该许可证。

0
likes
0
pub points
0%
popularity

Publisher

verified publisheryaozuopan.top

Persistent cache library for Dart(Flutter for iOS and Android).

Homepage
Repository

License

unknown (LICENSE)

Dependencies

encrypt, flutter, path_provider

More

Packages that depend on plain_cache