prefer-sized-box-square
Suggests using the SizedBox.square
constructor when height
and width
arguments have the same value.
Example
❌ Bad:
// LINT: Prefer using 'SizedBox.square' when the width and height are equal.
SizedBox(height: 10, width: 10);
✅ Good:
SizedBox(height: 10);
SizedBox(width: 10);
SizedBox(height: 10, width: 5);
SizedBox.square(dimension: 10);