Skip to content
📦Simple localstorage for flutter
Branch: master
Clone or download
1
Latest commit e4b2c73 May 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
lib
.gitignore 🐣 initial release Sep 21, 2018
CHANGELOG.md fix inconsistent return format May 14, 2019
LICENSE 🐣 initial release Sep 21, 2018
README.md fix inconsistent return format May 14, 2019
pubspec.lock v1.3.1 (#17) May 14, 2019
pubspec.yaml fix inconsistent return format May 14, 2019

README.md

Localstorage

Simple json file-based storage for flutter

Installation

Add dependency to pubspec.yaml

dependencies:
  ...
  localstorage: ^2.0.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

You can’t perform that action at this time.