dart-lang / linter

Linter for Dart.
https://dart.dev/tools/linter-rules
BSD 3-Clause "New" or "Revised" License
636 stars 170 forks source link

Incorrect use of ParentData Widget #4847

Open Number-3434 opened 10 months ago

Number-3434 commented 10 months ago

Describe the rule you'd like to see added and to what rule set

Lint

Lint to protect against the error "Incorrect Use of ParentData Widget" in Flutter.

Ruleset: flutter_lints

pq commented 10 months ago

@goderbauer

goderbauer commented 10 months ago

I am not sure how this lint would work or what cases it is supposed to catch. Can you add more context to your proposal?

Number-3434 commented 10 months ago

Usually this error occurs if a widget expects ParentData of BoxParentData and instead got FlexParentData (or vice versa).

Usually this can be fixed by inserting an Expanded widget in the correct place.