When I annotate a constructor parameter with @required
IntelliJ shows an error:
Annotation must be either a const variable reference or const constructor invocation
Can anyone suggest what I'm doing wrong?
class StatusBar extends StatelessWidget {
final String text;
const StatusBar({Key key, @required this.text})
: assert(text != null),
super(key: key);
@override
Widget build(BuildContext context) {
//...
}
}