proper_expanded_and_flexible

SeverityQuick FixOptions
Error

Details

DO place Expanded and Flexible widgets inside a Row, Column, or Flex.

Bad
Center(
  child: Expanded(
    child: Container(),
  ),
)
Good
Row(
  children: [
    Expanded(
      child: Container(),
    ),
  ],
)

Usage

To enable the proper_expanded_and_flexible rule, add proper_expanded_and_flexible under custom_lint > rules in your analysis_options.yaml file:

custom_lint:
  rules:
    - proper_expanded_and_flexible