Severity: AnalysisErrorSeverity.INFO
Maturity: experimental
Since 1.0.0
PREFER to always provide a value for props that are annotated a @requiredProp
s.
If a component has a props interface like this:
mixin NavItemProps on UiProps {
bool isActive;
@requiredProp
void Function() onDidActivate;
}
then the prop that is marked as "required" should always be set by the consumer:
GOOD:
@override
render() {
return (NavItem()
..onDidActivate = () {
// Do something
}
)(
'Activate me',
);
}
BAD:
@override
render() {
return NavItem()(
'You probably cannot activate me :(',
);
}