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

outdated

A fast, extra light and synchronous key-value storage written entirely in Dart

get_storage #

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

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');
1758
likes
0
pub points
100%
popularity

Publisher

verified publishergetx.site

A fast, extra light and synchronous key-value storage written entirely in Dart

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, path_provider

More

Packages that depend on get_storage