Fix newly reported prefer_const_constructors lints. (#54176)

This commit is contained in:
Konstantin Scheglov
2020-04-07 08:59:01 -07:00
committed by GitHub
parent ba18e99d1b
commit b0492cc976
11 changed files with 15 additions and 15 deletions

View File

@@ -19,7 +19,7 @@ void main() {
width: 400.0,
child: Row(
children: <Widget>[
Icon(Icons.message),
const Icon(Icons.message),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,

View File

@@ -32,7 +32,7 @@ class AnimatedPlaceholderPage extends StatelessWidget {
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 10),
itemBuilder: (BuildContext context, int index) {
return FadeInImage(
placeholder: DelayedBase64Image(Duration.zero, kAnimatedGif),
placeholder: const DelayedBase64Image(Duration.zero, kAnimatedGif),
image: DelayedBase64Image(Duration(milliseconds: 100 * index), kBlueSquare),
);
},

View File

@@ -66,7 +66,7 @@ class _BackdropFilterPageState extends State<BackdropFilterPage> with TickerProv
backgroundColor: Colors.grey,
body: Stack(
children: <Widget>[
Text('0' * 10000, style: TextStyle(color: Colors.yellow)),
Text('0' * 10000, style: const TextStyle(color: Colors.yellow)),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[

View File

@@ -24,9 +24,9 @@ class _ColorFilterAndFadePageState extends State<ColorFilterAndFadePage> with Ti
width: 24,
height: 24,
useColorFilter: _useColorFilter,
shadow: ui.Shadow(
shadow: const ui.Shadow(
color: Colors.black45,
offset: const Offset(0.0, 2.0),
offset: Offset(0.0, 2.0),
blurRadius: 4.0,
),
);

View File

@@ -263,7 +263,7 @@ class ListItem extends StatelessWidget {
),
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 250),
child: Text(
child: const Text(
kMockName,
maxLines: 1,
overflow: TextOverflow.ellipsis,

View File

@@ -52,7 +52,7 @@ class _PostBackdropFilterPageState extends State<PostBackdropFilterPage> with Ti
backgroundColor: Colors.grey,
body: Stack(
children: <Widget>[
Text('0' * 10000, style: TextStyle(color: Colors.yellow)),
Text('0' * 10000, style: const TextStyle(color: Colors.yellow)),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[

View File

@@ -108,7 +108,7 @@ class _MyHomePageState extends State<MyHomePage> {
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}