diff --git a/lib/main.dart b/lib/main.dart index 2d57adb..e53f8a7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -70,10 +70,17 @@ class MainAppState extends State { } } -void main() => runApp( - OKToast( - child: Store.init( - child: MainApp(), - ), +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + home: OKToast( + child: Store.init(child: MainApp()), ), ); + } +} + +void main() => runApp( + MyApp(), + ); diff --git a/lib/store/index.dart b/lib/store/index.dart index 6f1130e..dd2d030 100644 --- a/lib/store/index.dart +++ b/lib/store/index.dart @@ -17,7 +17,8 @@ class Store { return context; } - static init({child}) { + static init({child,context}) { + Store.context ??= context; return MultiProvider( child: child, providers: [ diff --git a/pubspec.yaml b/pubspec.yaml index 9a9a3f8..6b5ffed 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ description: A new Flutter project. # Both the version and the builder number may be overridden in flutter # build by specifying --build-name and --build-number, respectively. # Read more about versioning at semver.org. -version: 1.0.3+1 +version: 1.0.4+1 environment: sdk: ">=2.2.2 <3.0.0" diff --git a/version.json b/version.json index bcfa2c4..630f85e 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{"version":"1.0.3"} +{"version":"1.0.4"}