Skip to main content

avoid-flexible-outside-flex

Warns when a Flexible widget is used outside the Flex widget.

Example

❌ Bad:

class SomeWidget {
Widget build() {
return Column(children: [
Expanded(),
// LINT: Avoid Flexible widgets outside Row, Column or Flex widgets.
Container(Expanded()),
]);
}
}

✅ Good:

class SomeWidget {
Widget build() {
return Column(children: [
Expanded(),
Container(SomeOtherWidget()),
]);
}
}