apply upcoming lint prefer_const_literals_to_create_immutables (#14029)

This commit is contained in:
Alexandre Ardhuin
2018-01-11 08:38:55 +01:00
committed by GitHub
parent 5dc4ce85d9
commit 0fe1e5bf5b
63 changed files with 436 additions and 432 deletions

View File

@@ -193,7 +193,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('Pretend that this opened your SMS application.')
));
},
lines: <String>[
lines: const <String>[
'(650) 555-1234',
'Mobile',
],
@@ -206,7 +206,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('In this demo, this button doesn\'t do anything.')
));
},
lines: <String>[
lines: const <String>[
'(323) 555-6789',
'Work',
],
@@ -219,7 +219,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('Imagine if you will, a messaging application.')
));
},
lines: <String>[
lines: const <String>[
'(650) 555-6789',
'Home',
],
@@ -237,7 +237,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('Here, your e-mail application would open.')
));
},
lines: <String>[
lines: const <String>[
'ali_connors@example.com',
'Personal',
],
@@ -250,7 +250,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('This is a demo, so this button does not actually work.')
));
},
lines: <String>[
lines: const <String>[
'aliconnors@example.com',
'Work',
],
@@ -268,7 +268,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('This would show a map of San Francisco.')
));
},
lines: <String>[
lines: const <String>[
'2000 Main Street',
'San Francisco, CA',
'Home',
@@ -282,7 +282,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('This would show a map of Mountain View.')
));
},
lines: <String>[
lines: const <String>[
'1600 Amphitheater Parkway',
'Mountain View, CA',
'Work',
@@ -296,7 +296,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('This would also show a map, if this was not a demo.')
));
},
lines: <String>[
lines: const <String>[
'126 Severyns Ave',
'Mountain View, CA',
'Jet Travel',
@@ -308,25 +308,25 @@ class ContactsDemoState extends State<ContactsDemo> {
icon: Icons.today,
children: <Widget>[
new _ContactItem(
lines: <String>[
lines: const <String>[
'Birthday',
'January 9th, 1989',
],
),
new _ContactItem(
lines: <String>[
lines: const <String>[
'Wedding anniversary',
'June 21st, 2014',
],
),
new _ContactItem(
lines: <String>[
lines: const <String>[
'First day in office',
'January 20th, 2015',
],
),
new _ContactItem(
lines: <String>[
lines: const <String>[
'Last day in office',
'August 9th, 2015',
],

View File

@@ -441,7 +441,7 @@ class Tab2Header extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 18.0, vertical: 12.0),
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
children: const <Widget>[
const Text(
'SUPPORT TICKET',
style: const TextStyle(
@@ -725,10 +725,14 @@ class CupertinoDemoTab3 extends StatelessWidget {
child: new SafeArea(
top: false,
bottom: false,
child: new Row(children: <Widget>[ const Text(
'Sign in',
style: const TextStyle(color: CupertinoColors.activeBlue),
) ]),
child: new Row(
children: const <Widget>[
const Text(
'Sign in',
style: const TextStyle(color: CupertinoColors.activeBlue),
)
],
),
),
),
),

View File

@@ -96,7 +96,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
),
new Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
children: const <Widget>[
// Disabled checkboxes
const Checkbox(value: true, onChanged: null),
const Checkbox(value: false, onChanged: null)
@@ -136,7 +136,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
// Disabled radio buttons
new Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
children: const <Widget>[
const Radio<int>(
value: 0,
groupValue: 0,

View File

@@ -43,7 +43,7 @@ class _SliderDemoState extends State<SliderDemo> {
),
new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget> [
children: const <Widget> [
const Slider(value: 0.25, thumbOpenAtMin: true, onChanged: null),
const Text('Disabled'),
]

View File

@@ -17,7 +17,7 @@ class TwoLevelListDemo extends StatelessWidget {
new ExpansionTile(
title: const Text('Sublist'),
backgroundColor: Theme.of(context).accentColor.withOpacity(0.025),
children: <Widget>[
children: const <Widget>[
const ListTile(title: const Text('One')),
const ListTile(title: const Text('Two')),
// https://en.wikipedia.org/wiki/Free_Four

View File

@@ -362,13 +362,13 @@ class _RecipePageState extends State<RecipePage> {
],
),
],
flexibleSpace: new FlexibleSpaceBar(
background: new DecoratedBox(
decoration: new BoxDecoration(
gradient: new LinearGradient(
flexibleSpace: const FlexibleSpaceBar(
background: const DecoratedBox(
decoration: const BoxDecoration(
gradient: const LinearGradient(
begin: const Alignment(0.0, -1.0),
end: const Alignment(0.0, -0.2),
colors: <Color>[const Color(0x60000000), const Color(0x00000000)],
colors: const<Color>[const Color(0x60000000), const Color(0x00000000)],
),
),
),
@@ -444,7 +444,7 @@ class RecipeSheet extends StatelessWidget {
child: new Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
child: new Table(
columnWidths: <int, TableColumnWidth>{
columnWidths: const <int, TableColumnWidth>{
0: const FixedColumnWidth(64.0)
},
children: <TableRow>[

View File

@@ -336,7 +336,7 @@ class _CreateCompanySheet extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Column(
children: <Widget>[
children: const <Widget>[
const TextField(
autofocus: true,
decoration: const InputDecoration(

View File

@@ -50,7 +50,7 @@ class _StockSymbolView extends StatelessWidget {
text: new TextSpan(
style: DefaultTextStyle.of(context).style.merge(const TextStyle(fontSize: 8.0)),
text: 'Prices may be delayed by ',
children: <TextSpan>[
children: const <TextSpan>[
const TextSpan(text: 'several', style: const TextStyle(fontStyle: FontStyle.italic)),
const TextSpan(text: ' years.'),
]