You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently working on a small app using Flutter and Redux but having an issue when introducing navigation with flutter_redux.
class AddItemPageState extends State<AddItemPage> {
var controller = new TextEditingController();
@override
Widget build(BuildContext context) {
return new StoreConnector<AppState, AddItemPageModel>(
converter: (store) => AddItemPageModel.create(store),
builder: (BuildContext context, AddItemPageModel addItemPageViewModel) {
return new Scaffold(
body: new ListView(
children: <Widget>[
new TextField(
controller: this.controller,
decoration:
new InputDecoration(labelText: "Enter new to do item"),
onSubmitted: (String s) {
print(s);
controller.text = "";
addItemPageViewModel.onAddItem(s);
Navigator.pop(context);
},
)
],
));
});
}
}
When it tries to build this widget this exception is being thrown:
I/flutter (27229): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (27229): The following StoreProviderError was thrown building StoreConnector<AppState,
I/flutter (27229): AddItemPageModel>(dirty):
I/flutter (27356): Error: No StoreProvider found.
I'm new to Flutter and Redux but after reading a couple other Git issues on this I can't seem to find the fix. My understanding is you should call StoreProvider<AppState> at the root of your application, then use StoreConnector to access the store and map it to a view model. I've done exactly that but still I'm receiving this exception.
Currently working on a small app using Flutter and Redux but having an issue when introducing navigation with flutter_redux.
When it tries to build this widget this exception is being thrown:
I'm new to Flutter and Redux but after reading a couple other Git issues on this I can't seem to find the fix. My understanding is you should call
StoreProvider<AppState>
at the root of your application, then useStoreConnector
to access the store and map it to a view model. I've done exactly that but still I'm receiving this exception.The code is available here on the feature/usingSharedPreferences branch https://github.com/nikeshjobanputra/flutter-todo-app/tree/feature/usingSharedPreferences
I must be doing something stupid but I can't see where! Thanks in advance
The text was updated successfully, but these errors were encountered: