Enable use_colored_box lint (#117370)
This commit is contained in:
committed by
GitHub
parent
46bb85376b
commit
81bc54be75
@@ -67,9 +67,9 @@ class ContextMenuExample extends StatelessWidget {
|
||||
child: const Text('Delete'),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
child: const ColoredBox(
|
||||
color: CupertinoColors.systemYellow,
|
||||
child: const FlutterLogo(size: 500.0),
|
||||
child: FlutterLogo(size: 500.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -30,10 +30,10 @@ class DividerExample extends StatelessWidget {
|
||||
return Center(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Container(
|
||||
const Expanded(
|
||||
child: ColoredBox(
|
||||
color: Colors.amber,
|
||||
child: const Center(
|
||||
child: Center(
|
||||
child: Text('Above'),
|
||||
),
|
||||
),
|
||||
@@ -59,7 +59,7 @@ class DividerExample extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: ColoredBox(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
child: const Center(
|
||||
child: Text('Below'),
|
||||
|
||||
@@ -42,7 +42,7 @@ class _ReorderableExampleState extends State<ReorderableExample> {
|
||||
buildDefaultDragHandles: false,
|
||||
children: <Widget>[
|
||||
for (int index = 0; index < _items.length; index++)
|
||||
Container(
|
||||
ColoredBox(
|
||||
key: Key('$index'),
|
||||
color: _items[index].isOdd ? oddItemColor : evenItemColor,
|
||||
child: Row(
|
||||
|
||||
@@ -66,7 +66,7 @@ class _StarBorderExampleState extends State<StarBorderExample> {
|
||||
),
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
ColoredBox(
|
||||
color: Colors.grey.shade200,
|
||||
child: Options(_model),
|
||||
),
|
||||
|
||||
@@ -49,7 +49,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => _updateSize(),
|
||||
child: Container(
|
||||
child: ColoredBox(
|
||||
color: Colors.amberAccent,
|
||||
child: AnimatedSize(
|
||||
curve: Curves.easeIn,
|
||||
|
||||
@@ -34,7 +34,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return ColoredBox(
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
@@ -69,7 +69,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
onPointerDown: _incrementDown,
|
||||
onPointerMove: _updateLocation,
|
||||
onPointerUp: _incrementUp,
|
||||
child: Container(
|
||||
child: ColoredBox(
|
||||
color: Colors.lightBlueAccent,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
@@ -67,7 +67,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
onEnter: _incrementEnter,
|
||||
onHover: _updateLocation,
|
||||
onExit: _incrementExit,
|
||||
child: Container(
|
||||
child: ColoredBox(
|
||||
color: Colors.lightBlueAccent,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
@@ -36,7 +36,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
child: Container(
|
||||
child: ColoredBox(
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
||||
@@ -125,7 +125,7 @@ class MyStatelessWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return ColoredBox(
|
||||
color: Colors.white,
|
||||
child: FocusTraversalGroup(
|
||||
policy: OrderedTraversalPolicy(),
|
||||
|
||||
@@ -47,7 +47,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
child: SizedBox(
|
||||
width: 200,
|
||||
height: 200,
|
||||
child: Container(
|
||||
child: ColoredBox(
|
||||
color: Colors.red,
|
||||
child: AnimatedFractionallySizedBox(
|
||||
widthFactor: selected ? 0.25 : 0.75,
|
||||
@@ -55,9 +55,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
alignment: selected ? Alignment.topLeft : Alignment.bottomRight,
|
||||
duration: const Duration(seconds: 1),
|
||||
curve: Curves.fastOutSlowIn,
|
||||
child: Container(
|
||||
child: const ColoredBox(
|
||||
color: Colors.blue,
|
||||
child: const FlutterLogo(size: 75),
|
||||
child: FlutterLogo(size: 75),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -56,9 +56,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
||||
selected = !selected;
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
child: const ColoredBox(
|
||||
color: Colors.blue,
|
||||
child: const Center(child: Text('Tap me')),
|
||||
child: Center(child: Text('Tap me')),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -57,7 +57,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return ColoredBox(
|
||||
color: Colors.white,
|
||||
child: AlignTransition(
|
||||
alignment: _animation,
|
||||
|
||||
@@ -70,7 +70,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return ColoredBox(
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: DecoratedBoxTransition(
|
||||
|
||||
@@ -50,7 +50,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return ColoredBox(
|
||||
color: Colors.white,
|
||||
child: FadeTransition(
|
||||
opacity: _animation,
|
||||
|
||||
@@ -18,8 +18,8 @@ void main() {
|
||||
|
||||
expect(find.byType(Divider), findsOneWidget);
|
||||
|
||||
// Divider is positioned horizintally.
|
||||
final Offset container = tester.getBottomLeft(find.byType(Container).first);
|
||||
// Divider is positioned horizontally.
|
||||
final Offset container = tester.getBottomLeft(find.byType(ColoredBox).first);
|
||||
expect(container.dy, tester.getTopLeft(find.byType(Divider)).dy);
|
||||
|
||||
final Offset subheader = tester.getTopLeft(find.text('Subheader'));
|
||||
|
||||
Reference in New Issue
Block a user