get_storage 1.0.3 copy "get_storage: ^1.0.3" to clipboard
get_storage: ^1.0.3 copied to clipboard

outdated

A key-value storage extra-light and fast to Get framework

get_storage #

A fast, extra light and synchronous key-value storage to Get framework written entirely in Dart.

Supports Android, iOS, Web, Mac, Linux, and fuchsia (Wip on Windows).

Add to your pubspec:

dependencies:
  get_storage:

Initialize storage driver with await:

main() async {
  await GetStorage.init();
  runApp(App());
}

use GetStorage as instance:

GetStorage getx = GetStorage();

And use it. To write information you must use write :

 getx.write('quote', 'GetX is the best');

To read values you use read:

print(getx.read('quote'));
// out: GetX is the best

To remove a key, you can use remove:

 getx.remove('quote');

To listen changes you can use listen:

 getx.listen((event) {print(event);});

If you subscribe to events, be sure to dispose them when using:

 getx.dispose();

If you want to create different containers, simply give it a name. You can listen to specific containers, and also delete them.

GetStorage g = GetStorage('MyStorage');

To initialize specific container:

 await GetStorage.init('MyStorage');
1619
likes
0
pub points
99%
popularity

Publisher

verified publishergetx.site

A key-value storage extra-light and fast to Get framework

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, path_provider

More

Packages that depend on get_storage