Enable avoid_unnecessary_containers lint (#77294)

This commit is contained in:
Michael Goderbauer
2021-03-04 15:29:03 -08:00
committed by GitHub
parent c5d1600843
commit ed755fba5e
66 changed files with 689 additions and 849 deletions

View File

@@ -61,11 +61,9 @@ void main() {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: Container(
child: OutlinedButton(
onPressed: () { },
child: const Text('hello'),
),
body: OutlinedButton(
onPressed: () { },
child: const Text('hello'),
),
),
),
@@ -83,11 +81,9 @@ void main() {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: Container(
child: OutlinedButton(
onPressed: () { },
child: const Text('hello'),
),
body: OutlinedButton(
onPressed: () { },
child: const Text('hello'),
),
),
),
@@ -717,7 +713,7 @@ void main() {
shrinkWrap: true,
scrollDirection: Axis.horizontal,
// ListTile does not support horizontal list
itemBuilder: (BuildContext context, int i) => Container(child: Text('Item $i')),
itemBuilder: (BuildContext context, int i) => Text('Item $i'),
),
),
),

View File

@@ -153,9 +153,7 @@ void main() {
key: key1,
child: const Text('1'),
),
Container(
child: const Text('2'),
),
const Text('2'),
],
)),
);