localstorage 1.2.0 copy "localstorage: ^1.2.0" to clipboard
localstorage: ^1.2.0 copied to clipboard

outdated

Simple json file-based storage fo flutter. Alternative to react-native AsyncStorage

Localstorage #

Simple json file-based storage for flutter

Installation #

Add dependency to pubspec.yaml

dependencies:
  ...
  localstorage: ^1.2.0

Run in your terminal

flutter packages get

Example #

class SomeWidget extends StatelessWidget {
  final LocalStorage storage = new LocalStorage('some_key');

  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: storage.ready,
      builder: (BuildContext context, snapshot) {
        if (snapshot.data == true) {
          Map<String, dynamic> data = storage.getItem('key');

          return SomeDataView(data: data);
        } else {
          return SomeLoadingStateWidget();
        }
      },
    );
  }
}

License #

MIT

362
likes
0
pub points
98%
popularity

Publisher

verified publisherlesnitsky.dev

Simple json file-based storage fo flutter. Alternative to react-native AsyncStorage

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, path_provider

More

Packages that depend on localstorage