• Stars
    star
    279
  • Rank 147,383 (Top 3 %)
  • Language
    Dart
  • License
    MIT License
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📦flutter localstorage for ios/android/desktop/web

Localstorage

Simple json file-based storage for flutter

Installation

Add dependency to pubspec.yaml

dependencies:
  ...
  localstorage: ^4.0.0+1

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();
        }
      },
    );
  }
}

V2 -> v3 migration

V3 doesn't add .json extension to a storage filename, so you need to do this on your own if you need a "migration". If you were using v2 with code like below:

final storage = new LocalStorage('my_data');

v3 equivalent:

final storage = new LocalStorage('my_data.json')

Integration tests

cd ~/flutter_localstorage/test
flutter packages get
flutter drive --target=lib/main.dart

License

MIT

More Repositories

1

git-tutor

:octocat:+md=❤️ Awesome tutorials from your git log
JavaScript
385
star
2

react-native-webview-messaging

✉️ Send/Receive data between React Native app and WebView
JavaScript
264
star
3

howtodothisinflutter

📄Flutter cheat sheet
JavaScript
262
star
4

webgl-month

🎓 Daily WebGL tutorials
JavaScript
211
star
5

native_context_menu

Native context menu for Flutter apps
C++
157
star
6

flutter_desktop_plugins

Flutter desktop plugins
Ruby
50
star
7

fps_jank_flash_widget

🟥 A flutter widget that flashes when flutter fails to render a frame in a certain timeframe
C++
34
star
8

local_assets_server

📦 Local server which serves assets to WebView
Dart
29
star
9

events2

ES2015 implementation of nodejs EventEmitter
JavaScript
28
star
10

editorconfig-cli

📝🔧 initialize .editorconfig in your terminal
JavaScript
27
star
11

front-end-interview

Front-end interview questions
27
star
12

infinite_view_pager

📜Infinite View Pager widget for Flutter
Dart
26
star
13

bloc_auth_tdd

❌✅Refactor BloC
HTML
26
star
14

guard

🛡try/catch with default value in case of exception or result is null
Dart
23
star
15

dynamic_app_icon

Set any widget as an app icon! (macOS only)
Dart
21
star
16

tic-tac-toe

An example tutorial built with git-tutor https://github.com/lesnitsky/git-tutor
JavaScript
20
star
17

network_state

🌎 Service aware network state plugin
Dart
20
star
18

inherited_builder

🤖Autogenerated state management and dependency injection with inherited widgets
Dart
15
star
19

editr

📝Simple text editor
TypeScript
13
star
20

my-setup

List of apps and tools I use
12
star
21

flutter_code_evenings

🌙Flutter Code Evening event series repo
Dart
11
star
22

pure_widget

Base Flutter widget which triggers rebuild only of props changed
Dart
9
star
23

fps_widget

FPS Widget for Flutter
Dart
9
star
24

microfrontends

Dart
9
star
25

null_widget

☁️ Lightweight placeholder widget for flutter
Dart
8
star
26

deep_map

getDeep and setDeep for dart maps
Dart
7
star
27

level_db

LevelDB for Flutter
Dart
7
star
28

new-tab

➕ Minimalistic chrome new tab
JavaScript
6
star
29

perf_timer

⏱Perf timer for dart and flutter
Dart
6
star
30

redux-saga-chai

Chai extension for testing sagas
JavaScript
5
star
31

cognito-github-oidc

GitHub OAuth openid shim for AWS Cognito
TypeScript
5
star
32

lifecycle_widget

widget with lifecycle hooks for flutter
Dart
5
star
33

dart_libgit2

Dart bindings to libgit2
Dart
5
star
34

nodejs-workshop

JavaScript
5
star
35

contextualized

Context is a HashMap with shadowing (inherits parent values) and helpers to work with Types as keys
Dart
4
star
36

matches

Collection of useful patterns for Dart
Dart
4
star
37

dash_3d

Dart
4
star
38

flutter_learners_app

Dart
4
star
39

notifications_stream

Utility widget which writes notifications into stream
Dart
4
star
40

license

CLI license generator
Dart
3
star
41

flutter_env_vars

📦Container for environment variables
Dart
3
star
42

flutter_interview_questions

3
star
43

flutter_ts

TypeScript
2
star
44

tdlib_bindings

Telegram Database Library ffi bindings for dart
Dart
2
star
45

dart-docker-server-starter

A preconfgiured template for dockerized dart server apps
Dart
1
star
46

http_routes

↪Utility to match http requests with routes
Dart
1
star
47

ui_paragraph

Dart
1
star
48

sls-starter

Template for serverless APIs with typescript and dynamodb
TypeScript
1
star
49

http_sugar

🍭Sugar methods for HttpRequest and HttpResponse
Dart
1
star
50

0110011001110000

Haskell
1
star
51

alfred-workflows

🎩Alfred workflows I use
1
star
52

shields

Generates shields for your readme
Dart
1
star
53

domainavailable

Want new sexy domain? Check whether it is available
JavaScript
1
star
54

readme

Generates README for your flutter package
Dart
1
star
55

try-nexus

Does nexus.js work?
CoffeeScript
1
star
56

lgi-hackathon-service

JavaScript
1
star
57

tmpl

Dart
1
star
58

lang_ui

Dart
1
star
59

flutter_context

React-like Context API for Flutter
C++
1
star
60

sweetdream

Nightmare.js with single electron main process
JavaScript
1
star
61

flutter_firebase_chat

GDG 2020-02-07 Meetup Demo
Dart
1
star
62

node-ts-express-docker-starter

Pre-configured Node.js app with Typescript, Express and Docker
TypeScript
1
star
63

serverless-plugin-resource-deep-merge

Serverless plugin which allows updating CloudFormation template
JavaScript
1
star
64

tokenizer

Converts a stream of strings into stream of tokens splitted by delimiters
Dart
1
star