use_container_property_as_possible

Group: style

Maturity: stable

Code Sharp v0.0.1

Since info is static, may be stale
flutter

View all Lint Rules

Using the Linter

Use Container property as possible.

A Container is combined common painting, positioning, and sizing widgets, so his 'child' can use its properties directly.

BAD:

Container(
  height: 77.0,
  width: 77.0,
  child: Center(
    child: FlutterLogo(),
  ),
)

GOOD:

Container(
  height: 77.0,
  width: 77.0,
  alignment: Alignment.center,
  child: FlutterLogo(),
)