Enable use_colored_box lint (#117370)

This commit is contained in:
Michael Goderbauer
2022-12-20 14:09:55 -08:00
committed by GitHub
parent 46bb85376b
commit 81bc54be75
72 changed files with 198 additions and 194 deletions

View File

@@ -524,7 +524,7 @@ class ItemGalleryBox extends StatelessWidget {
child: Column(
children: <Widget>[
Expanded(
child: Container(
child: ColoredBox(
color: Theme.of(context).primaryColor,
child: Center(
child: Text(tabName, style: Theme.of(context).textTheme.headlineSmall!.copyWith(color: Colors.white)),

View File

@@ -91,7 +91,7 @@ class _BackdropFilterPageState extends State<BackdropFilterPage> with TickerProv
child: addBlur(grid(txt, 17, 5), _blurGroup),
),
const SizedBox(height: 20),
Container(
ColoredBox(
color: Colors.white,
child:Row(
mainAxisAlignment: MainAxisAlignment.center,

View File

@@ -74,9 +74,9 @@ class _PostBackdropFilterPageState extends State<PostBackdropFilterPage> with Ti
),
getConditionalBackdrop(),
RepaintBoundary(
child: Container(
child: ColoredBox(
color: Colors.white,
child:Row(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text('Include BackdropFilter:'),

View File

@@ -88,7 +88,7 @@ class WindowManagerBodyState extends State<WindowManagerBody> {
Widget _statusWidget() {
assert(_lastTestStatus != _LastTestStatus.pending);
final String? message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError;
return Container(
return ColoredBox(
color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
child: Text(
message!,

View File

@@ -520,7 +520,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
final List<Widget> headings = <Widget>[];
for (int index = 0; index < allSections.length; index++) {
headings.add(Container(
headings.add(ColoredBox(
color: _kAppBackgroundColor,
child: ClipRect(
child: _AllSectionsView(

View File

@@ -214,7 +214,7 @@ class Tab1RowItem extends StatelessWidget {
),
));
},
child: Container(
child: ColoredBox(
color: CupertinoDynamicColor.resolve(CupertinoColors.systemBackground, context),
child: SafeArea(
top: false,

View File

@@ -95,7 +95,7 @@ over water meant for the whole central valley of California? The story will shoc
return SingleChildScrollView(
child: SafeArea(
top: false,
child: Container(
child: ColoredBox(
color: Theme.of(context).colorScheme.surface,
child: Column(
children: <Widget>[

View File

@@ -358,7 +358,7 @@ class _BackdropDemoState extends State<BackdropDemo> with SingleTickerProviderSt
);
}).toList();
return Container(
return ColoredBox(
key: _backdropKey,
color: theme.primaryColor,
child: Stack(

View File

@@ -243,7 +243,7 @@ class _LeaveBehindListItem extends StatelessWidget {
}
return false;
},
background: Container(
background: ColoredBox(
color: theme.primaryColor,
child: const Center(
child: ListTile(
@@ -251,7 +251,7 @@ class _LeaveBehindListItem extends StatelessWidget {
),
),
),
secondaryBackground: Container(
secondaryBackground: ColoredBox(
color: theme.primaryColor,
child: const Center(
child: ListTile(

View File

@@ -122,7 +122,7 @@ class NestedViewEventBodyState extends State<NestedViewEventBody> {
Widget _statusWidget() {
assert(_lastTestStatus != _LastTestStatus.pending);
final String message = _lastTestStatus == _LastTestStatus.success ? 'Success' : lastError!;
return Container(
return ColoredBox(
color: _lastTestStatus == _LastTestStatus.success ? Colors.green : Colors.red,
child: Text(
message,

View File

@@ -66,7 +66,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
body: Column(
children: <Widget>[
Container(color: Colors.grey.shade200, child: Options(_model)),
ColoredBox(color: Colors.grey.shade200, child: Options(_model)),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,

View File

@@ -508,7 +508,7 @@ class _FuzzerState extends State<Fuzzer> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Container(
return ColoredBox(
color: Colors.black,
child: Column(
children: <Widget>[
@@ -577,7 +577,7 @@ class _UnderlinesState extends State<Underlines> {
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Container(
return ColoredBox(
color: Colors.black,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -680,7 +680,7 @@ class _FallbackState extends State<Fallback> {
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Container(
return ColoredBox(
color: Colors.black,
child: Column(
children: <Widget>[
@@ -754,7 +754,7 @@ class Bidi extends StatefulWidget {
class _BidiState extends State<Bidi> {
@override
Widget build(BuildContext context) {
return Container(
return ColoredBox(
color: Colors.black,
child: ListView(
padding: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 20.0),
@@ -862,7 +862,7 @@ class _ZalgoState extends State<Zalgo> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Container(
return ColoredBox(
color: Colors.black,
child: Column(
children: <Widget>[
@@ -988,7 +988,7 @@ class _PaintingState extends State<Painting> with SingleTickerProviderStateMixin
@override
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
return Container(
return ColoredBox(
color: Colors.black,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,