Pattern: Use of unnecessary Container
Issue: -
Wrapping a widget in Container
with no other parameters set has no effect and makes code needlessly more complex.
Example of incorrect code:
Widget buildRow() {
return Container(
child: Row(
children: <Widget>[
const MyLogo(),
const Expanded(
child: Text('...'),
),
],
)
);
}
Example of correct code:
Widget buildRow() {
return Row(
children: <Widget>[
const MyLogo(),
const Expanded(
child: Text('...'),
),
],
);
}