Severity: AnalysisErrorSeverity.ERROR
Maturity: stable
Since 1.0.0
ALWAYS surround arrow functions in cascading setters with parentheses.
Otherwise, subsequent cascades do not work properly.
GOOD:
EventTarget target;
(Dom.button()
..onClick = ((event) => eventTarget = event.target)
..id = 'foo'
)()
BAD:
EventTarget target;
(Dom.button()
..onClick = (event) => eventTarget = event.target
// This id will not get set on the button
..id = 'foo'
)()