avoid_single_child_in_flex

SeverityQuick FixOptions
Info

Details

Avoid using Column or Row with only one child.

Bad
Row(
  children: [
    Placeholder(),
  ],
)
Good
Align(
  child: Placeholder(),
)

// or

Center(
  child: Placeholder(),
)

Usage

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

custom_lint:
  rules:
    - avoid_single_child_in_flex