Open bailerG opened 1 month ago
@goderbauer
IIRC we've discussed a similar proposal in the past.
I don't think we want to implement a lint like this using a hardcoded list of valid (parent, child) pairs. It's too easy for such a list to get out of sync with the widget library as the library evolves.
I suspect that instead we'd want to create an annotation that can be used by a widget author to specify any constraints on where the widget can be placed. Not only would that allow widget authors to update the constraints as the implementation changes, it would also allow widgets outside flutter
to express the same constraints.
A lint to avoid cases where a Flexible widget is placed outside a Row or Column and furthermore avoid blank screens on production would be very helpful and useful.