Last updated:
0 purchases
flutter lightweight store
flutter_lightweight_store #
A light weight key-value store (SharedPreferences & NSUserdefaults) with saving to separated/customizable xml/plist.
Usage #
Please run example/lib/main.dart for more demonstrations
/// Mark this instance as static, then you can access it across the app
/// 💚 We will save the key-value data to a file named `com.your.name.xml` on Android or `com.your.name.plist` on iOS
FlutterLightweightStoreModule sp = FlutterLightweightStoreModule("com.your.name");
/// setter
await sp.setString("String", "Hello world");
await sp.setInt("Int", 10086);
await sp.setDouble("Double", 10086.12306);
await sp.setBoolean("Boolean", true);
/// getter
var str = await sp.getString("String");
var int = await sp.getInt("Int");
var double = await sp.getDouble("Double");
var boolean = await sp.getBoolean("Boolean");
print('✅[SP] setter & getter: string -> $str, int -> $int, double -> $double, boolean -> $boolean');
/// remove
await sp.removeKey('StringKey');
/// contains
bool isContains = await sp.contains('StringKey');
copied to clipboard
Features and bugs #
Please feel free to: request new features and bugs at the issue tracker
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.