File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 5
5
A wrapper over [ InheritedModel] ( https://api.flutter.dev/flutter/widgets/InheritedModel-class.html ) ,
6
6
this module allows users to easily share global state between multiple widgets.
7
7
8
- It's a no -boilerplate generalization of the ` Provider ` state management solution.
8
+ It's a low -boilerplate generalization of the ` Provider ` state management solution.
9
9
10
10
## Usage
11
11
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class _MyHomePageState extends State<MyHomePage> {
41
41
Widget build (BuildContext context) {
42
42
// The .of(context) bit makes this widget rebuild everytime counter is changed
43
43
int counterValue = counter.of (context);
44
+ counter.value = counterValue;
44
45
45
46
return Scaffold (
46
47
appBar: AppBar (
@@ -72,7 +73,8 @@ class _MyHomePageState extends State<MyHomePage> {
72
73
void initState () {
73
74
super .initState ();
74
75
75
- counter.load (); // load previous value from shared prefs
76
+ // load previous value from shared prefs
77
+ counter.load ();
76
78
}
77
79
78
80
Future <void > _incrementCounter () async {
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ packages:
127
127
path: ".."
128
128
relative: true
129
129
source: path
130
- version: "0.2 .0"
130
+ version: "0.3 .0"
131
131
sky_engine:
132
132
dependency: transitive
133
133
description: flutter
You can’t perform that action at this time.
0 commit comments