Skip to content

adriancmurray/flutter_localstorage

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

📦Simple localstorage for flutter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 65.3%
  • Ruby 22.7%
  • Objective-C 8.1%
  • Java 3.9%