Closed huoda1237 closed 3 years ago
你好,我是来自中国的朋友,当我运行这个demo的时候遇到了上面的问题,请帮我分析下是什么原因,谢谢
It's saying it couldn't find a StoreProvider<AppState>
in the tree above one of your store connector widgets.
Up in your tree you must have this:
StoreProvider<AppState>(
store: myStore,
child: MaterialApp( ...
If you want to get more information from the error message, you can pass the debug: this
parameter to all your store connectors. For example:
return StoreConnector<AppState, SignInViewModel>(
debug: this,
Then, instead of (debug info: Null)
you will get the name of the store connector which is failing.
The following StoreConnectorError was thrown building StoreConnector<AppState, SignInViewModel>(dirty): Error: No StoreProvider found. (debug info: Null)
The relevant error-causing widget was StoreConnector<AppState, SignInViewModel> lib/…/sign_in/sign_in_connector.dart:13 When the exception was thrown, this was the stack
0 StoreProvider.of
package:async_redux/src/store.dart:766
1 StoreConnector.build
package:async_redux/src/store.dart:950
2 StatelessElement.build
package:flutter/…/widgets/framework.dart:4569
3 ComponentElement.performRebuild
packa