Open nitrico opened 6 years ago
Thanks for reporting this @nitrico! The repository pre-dates dart 2 and I haven't tried it with --preview-dart-2
yet, I'll give it a look and update soon.
At a quick glance the culprit is probably todoAppReducer's usage of TodoAction
to specify the action parameter's type, replacing that with dynamic
might unblock you.
Thank you, for the answer and the project :)
Yes, that's what I've tried after that and now it works fine for iOS (both debug and release) and Android in debug mode but not in release. Weird...
I am wanting to dive deeper into state management but I was unable to get this to work for me. I really like this project structure but I am a flutter/dart noob.
At a quick glance the culprit is probably todoAppReducer's usage of TodoAction to specify the action parameter's type, replacing that with dynamic might unblock you.
Wish I could say that was enough to help me get running w/Dart 2 .
I tried changing the 'method signature' to something like ...
List<Todo> todosReducer(List<Todo> state, action)
Which got me closer (starts to load on iPhone 6)... embarrassingly, I'm not sure if that is stupid but it still does not boot :(
type 'Store<dynamic>' is not a subtype of type 'Store<TodoState>'
Fixed that by declaring it specifically ...
final Store<TodoState> store = new Store<TodoState>(todoAppReducer, initialState: new TodoState.initialState());
... but ...
flutter: Another exception was thrown: NoSuchMethodError: The getter 'store' was called on null.
To my eyes, this app looks like a top notch implementation of a simple redux app, wish I could boot it 👍
The function 'todoAppReducer' has type '(TodoState, TodoAction) → TodoState' that isn't of expected type '(TodoState, dynamic) → TodoState'. This means its parameter or return type does not match what is expected.
=> I get this error. So how to resolve it bro????
Trying to run this app with Dart 2 causes this
I tried to solve it by replacing
with
in
main.dart
. But then I get this error:Any idea on how to solve it?