Skip to content

Commit 0004b1c

Browse files
committed
Merge branch 'master' into misc-fixes
2 parents 9388be1 + a0862a4 commit 0004b1c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ To get a hold of `StreamingSharedPreferences`, _await_ on `instance`:
2525
import 'package:streaming_shared_preferences/streaming_shared_preferences.dart';
2626
2727
...
28+
WidgetsFlutterBinding.ensureInitialized();
2829
final preferences = await StreamingSharedPreferences.instance;
2930
```
3031

@@ -111,6 +112,7 @@ Now we can pass `MyAppSettings` down to the widgets that use it:
111112

112113
```dart
113114
Future<void> main() async {
115+
WidgetsFlutterBinding.ensureInitialized();
114116
/// Obtain instance to streaming shared preferences, create MyAppSettings, and
115117
/// once that's done, run the app.
116118
final preferences = await StreamingSharedPreferences.instance;

example/lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class MyAppSettings {
1818
}
1919

2020
Future<void> main() async {
21+
WidgetsFlutterBinding.ensureInitialized();
22+
2123
/// Obtain instance to streaming shared preferences, create MyAppSettings, and
2224
/// once that's done, run the app.
2325
final preferences = await StreamingSharedPreferences.instance;

0 commit comments

Comments
 (0)