代码:
@override
Widget build(BuildContext context) {
return StoreProvider(
store: store,
child: MaterialApp(
...
)
)
}
错误:
* Wrapping your MaterialApp with the StoreProvider<State>,
flutter: rather than an individual Route
flutter: * Providing full type information to your Store<State>,
flutter: StoreProvider<State> and StoreConnector<State, ViewModel>
flutter: * Ensure you are using consistent and complete imports.
flutter: E.g. always use `import 'package:my_app/app_state.dart';
调整:
@override
Widget build(BuildContext context) {
return StoreProvider<AppState>(
store: store,
child: MaterialApp(
...
)
)
}