Fix newly reported prefer_const_constructors lints. (#54176)
This commit is contained in:
parent
ba18e99d1b
commit
b0492cc976
@ -19,7 +19,7 @@ void main() {
|
|||||||
width: 400.0,
|
width: 400.0,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(Icons.message),
|
const Icon(Icons.message),
|
||||||
Column(
|
Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
@ -32,7 +32,7 @@ class AnimatedPlaceholderPage extends StatelessWidget {
|
|||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 10),
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 10),
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return FadeInImage(
|
return FadeInImage(
|
||||||
placeholder: DelayedBase64Image(Duration.zero, kAnimatedGif),
|
placeholder: const DelayedBase64Image(Duration.zero, kAnimatedGif),
|
||||||
image: DelayedBase64Image(Duration(milliseconds: 100 * index), kBlueSquare),
|
image: DelayedBase64Image(Duration(milliseconds: 100 * index), kBlueSquare),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -66,7 +66,7 @@ class _BackdropFilterPageState extends State<BackdropFilterPage> with TickerProv
|
|||||||
backgroundColor: Colors.grey,
|
backgroundColor: Colors.grey,
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text('0' * 10000, style: TextStyle(color: Colors.yellow)),
|
Text('0' * 10000, style: const TextStyle(color: Colors.yellow)),
|
||||||
Column(
|
Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -24,9 +24,9 @@ class _ColorFilterAndFadePageState extends State<ColorFilterAndFadePage> with Ti
|
|||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
useColorFilter: _useColorFilter,
|
useColorFilter: _useColorFilter,
|
||||||
shadow: ui.Shadow(
|
shadow: const ui.Shadow(
|
||||||
color: Colors.black45,
|
color: Colors.black45,
|
||||||
offset: const Offset(0.0, 2.0),
|
offset: Offset(0.0, 2.0),
|
||||||
blurRadius: 4.0,
|
blurRadius: 4.0,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -263,7 +263,7 @@ class ListItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
ConstrainedBox(
|
ConstrainedBox(
|
||||||
constraints: const BoxConstraints(maxWidth: 250),
|
constraints: const BoxConstraints(maxWidth: 250),
|
||||||
child: Text(
|
child: const Text(
|
||||||
kMockName,
|
kMockName,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
|
@ -52,7 +52,7 @@ class _PostBackdropFilterPageState extends State<PostBackdropFilterPage> with Ti
|
|||||||
backgroundColor: Colors.grey,
|
backgroundColor: Colors.grey,
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Text('0' * 10000, style: TextStyle(color: Colors.yellow)),
|
Text('0' * 10000, style: const TextStyle(color: Colors.yellow)),
|
||||||
Column(
|
Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
|
@ -108,7 +108,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: _incrementCounter,
|
onPressed: _incrementCounter,
|
||||||
tooltip: 'Increment',
|
tooltip: 'Increment',
|
||||||
child: Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
), // This trailing comma makes auto-formatting nicer for build methods.
|
), // This trailing comma makes auto-formatting nicer for build methods.
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
|
|||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
onPressed: _incrementCounter,
|
onPressed: _incrementCounter,
|
||||||
tooltip: 'Increment',
|
tooltip: 'Increment',
|
||||||
child: Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
runApp(
|
runApp(
|
||||||
DecoratedBox(
|
DecoratedBox(
|
||||||
decoration: BoxDecoration(color: Colors.white),
|
decoration: const BoxDecoration(color: Colors.white),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -43,14 +43,14 @@ void main() {
|
|||||||
},
|
},
|
||||||
itemBuilder: (BuildContext context) {
|
itemBuilder: (BuildContext context) {
|
||||||
return <PopupMenuItem<int>>[
|
return <PopupMenuItem<int>>[
|
||||||
PopupMenuItem<int>(
|
const PopupMenuItem<int>(
|
||||||
value: 1,
|
value: 1,
|
||||||
child: Text(
|
child: Text(
|
||||||
'hello, world',
|
'hello, world',
|
||||||
style: TextStyle(color: Colors.blue),
|
style: TextStyle(color: Colors.blue),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PopupMenuItem<int>(
|
const PopupMenuItem<int>(
|
||||||
value: 2,
|
value: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
'你好,世界',
|
'你好,世界',
|
||||||
@ -129,14 +129,14 @@ void main() {
|
|||||||
},
|
},
|
||||||
itemBuilder: (BuildContext context) {
|
itemBuilder: (BuildContext context) {
|
||||||
return <PopupMenuItem<int>>[
|
return <PopupMenuItem<int>>[
|
||||||
PopupMenuItem<int>(
|
const PopupMenuItem<int>(
|
||||||
value: 1,
|
value: 1,
|
||||||
child: Text(
|
child: Text(
|
||||||
'hello, world',
|
'hello, world',
|
||||||
style: TextStyle(color: Colors.blue),
|
style: TextStyle(color: Colors.blue),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PopupMenuItem<int>(
|
const PopupMenuItem<int>(
|
||||||
value: 2,
|
value: 2,
|
||||||
child: Text(
|
child: Text(
|
||||||
'你好,世界',
|
'你好,世界',
|
||||||
|
@ -72,5 +72,5 @@ List<IOSEmulator> getEmulators() {
|
|||||||
return <IOSEmulator>[];
|
return <IOSEmulator>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
return <IOSEmulator>[IOSEmulator(iosSimulatorId)];
|
return <IOSEmulator>[const IOSEmulator(iosSimulatorId)];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user