Closed as not planned
Closed as not planned
Description
It's common for @required named parameters to be non-null.
class Foo {
Foo({ @required this.bar }) : assert(bar != null);
final String bar;
}
void main() {
Foo foo = Foo();
}
Currently, upon "hot restart", this idiomatic Flutter class fails with:
E/flutter (22230): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: 'package:test_issue/main.dart': Failed assertion: line 4 pos 40: 'bar != null': is not true.
It would be somewhat more informative if it failed with a message like:
E/flutter (22230): 'package:test_issue/main.dart': required Foo parameter bar must not be null, line 4 pos 40
For Flutter classes it might also be helpful if a link to the API doc for the required parameter was provided.
This issue was originally reported here: flutter/flutter#29046 (comment)