Open asashour opened 1 year ago
How often do users produce code that looks like this unintentionally?
That is, how big of a problem is it?
How often do users produce code that looks like this intentionally in order to keep the right layout? How often to users temporarily produce code that looks like this, intending to populate the children of the widget?
That is, how often will this result in false positives?
My guess is that it will produce false positives more often than it will catch valid errors.
@goderbauer For a more informed opinion.
ternary_operator_with_empty_widget
Description
Avoid having a ternary condition operator with an empty widget inside a collection.
Details
There is no need to have a ternary operator when one of the expressions is an empty widget, e.g.
SizedBox()
orContainer()
. Acollection if
can be used instead.Kind
Avoid
Bad Examples
Good Examples
Discussion
Having
if
inside an array, is probably not intuitive for new users.Discussion checklist