Closed jonahwilliams closed 6 years ago
Thanks! I nitpicked about one tiny thing.
Also, is there an analysis option or similar which automatically suggests using const instead of new where appropriate?
Yes, I've added an example analysis_options.yaml
which includes the prefer_const_constructors
lint. This will catch all places where you could insert a const
, turns out I missed a few too.
I've also added one more option in the language setting, this is a config necessary to make flutter work with the linter. Finally there is a commented out line too: implicit-dynamic: false
will help make your code dart 2 safe, since it will try and prevent you from accidentally using dynamic
and passing that to something that expects a more specific type. This was generally okay in dart 1, but it's not really safe. A quick example:
void takesAMap(Map<String, String> foo) { ... }
...
Map foo = {};
takesAMap(foo); // Okay in dart 1, will fail at runtime in dart 2
Thanks!
The last commit actually made the Travis build fail, and it fails locally for me as well. Do you have time to either revert it or investigate how to test errors in Futures? If not, I'm happy to continue.
That is very odd, I needed that change for the test to pass locally. Possibly due to slightly different flutter versions?
Thanks a lot! Hopefully, I'll see you in I/O to thank in person!
I've added
const
where it could be trivially swapped for new. I did indulge myself a little and swapped around widget construction instoryline_widget.dart
to make more of the text widgets const.Fixes https://github.com/roughike/inKino/issues/71