Unverified Commit 0fe1e5bf authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

apply upcoming lint prefer_const_literals_to_create_immutables (#14029)

parent 5dc4ce85
...@@ -267,7 +267,7 @@ class IconBar extends StatelessWidget { ...@@ -267,7 +267,7 @@ class IconBar extends StatelessWidget {
padding: const EdgeInsets.only(left: 16.0, right: 16.0), padding: const EdgeInsets.only(left: 16.0, right: 16.0),
child: new Row( child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: const <Widget>[
const IconWithText(Icons.thumb_up, 'Like'), const IconWithText(Icons.thumb_up, 'Like'),
const IconWithText(Icons.comment, 'Comment'), const IconWithText(Icons.comment, 'Comment'),
const IconWithText(Icons.share, 'Share'), const IconWithText(Icons.share, 'Share'),
...@@ -438,10 +438,10 @@ class ItemImageBox extends StatelessWidget { ...@@ -438,10 +438,10 @@ class ItemImageBox extends StatelessWidget {
borderRadius: new BorderRadius.circular(2.0) borderRadius: new BorderRadius.circular(2.0)
), ),
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
child: new RichText( child: const RichText(
text: new TextSpan( text: const TextSpan(
style: const TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),
children: <TextSpan>[ children: const <TextSpan>[
const TextSpan( const TextSpan(
text: 'Photo by ' text: 'Photo by '
), ),
...@@ -560,7 +560,7 @@ class BottomBar extends StatelessWidget { ...@@ -560,7 +560,7 @@ class BottomBar extends StatelessWidget {
), ),
child: new Row( child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: const <Widget>[
const BottomBarButton(Icons.new_releases, 'News'), const BottomBarButton(Icons.new_releases, 'News'),
const BottomBarButton(Icons.people, 'Requests'), const BottomBarButton(Icons.people, 'Requests'),
const BottomBarButton(Icons.chat, 'Messenger'), const BottomBarButton(Icons.chat, 'Messenger'),
......
...@@ -66,7 +66,7 @@ class DriverTestAppState extends State<DriverTestApp> { ...@@ -66,7 +66,7 @@ class DriverTestAppState extends State<DriverTestApp> {
_selectedValue = newValue; _selectedValue = newValue;
}); });
}, },
items: <DropdownMenuItem<Letter>>[ items: const <DropdownMenuItem<Letter>>[
const DropdownMenuItem<Letter>( const DropdownMenuItem<Letter>(
value: Letter.a, value: Letter.a,
child: const Text('Aaa', key: const ValueKey<String>('a')), child: const Text('Aaa', key: const ValueKey<String>('a')),
......
...@@ -347,8 +347,8 @@ class CardCollectionState extends State<CardCollection> { ...@@ -347,8 +347,8 @@ class CardCollectionState extends State<CardCollection> {
return new LinearGradient( return new LinearGradient(
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
colors: <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)], colors: const <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)],
stops: <double>[0.1, 0.35], stops: const <double>[0.1, 0.35],
) )
.createShader(bounds); .createShader(bounds);
} }
......
...@@ -193,7 +193,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -193,7 +193,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('Pretend that this opened your SMS application.') content: const Text('Pretend that this opened your SMS application.')
)); ));
}, },
lines: <String>[ lines: const <String>[
'(650) 555-1234', '(650) 555-1234',
'Mobile', 'Mobile',
], ],
...@@ -206,7 +206,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -206,7 +206,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('In this demo, this button doesn\'t do anything.') content: const Text('In this demo, this button doesn\'t do anything.')
)); ));
}, },
lines: <String>[ lines: const <String>[
'(323) 555-6789', '(323) 555-6789',
'Work', 'Work',
], ],
...@@ -219,7 +219,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -219,7 +219,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('Imagine if you will, a messaging application.') content: const Text('Imagine if you will, a messaging application.')
)); ));
}, },
lines: <String>[ lines: const <String>[
'(650) 555-6789', '(650) 555-6789',
'Home', 'Home',
], ],
...@@ -237,7 +237,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -237,7 +237,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('Here, your e-mail application would open.') content: const Text('Here, your e-mail application would open.')
)); ));
}, },
lines: <String>[ lines: const <String>[
'ali_connors@example.com', 'ali_connors@example.com',
'Personal', 'Personal',
], ],
...@@ -250,7 +250,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -250,7 +250,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('This is a demo, so this button does not actually work.') content: const Text('This is a demo, so this button does not actually work.')
)); ));
}, },
lines: <String>[ lines: const <String>[
'aliconnors@example.com', 'aliconnors@example.com',
'Work', 'Work',
], ],
...@@ -268,7 +268,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -268,7 +268,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('This would show a map of San Francisco.') content: const Text('This would show a map of San Francisco.')
)); ));
}, },
lines: <String>[ lines: const <String>[
'2000 Main Street', '2000 Main Street',
'San Francisco, CA', 'San Francisco, CA',
'Home', 'Home',
...@@ -282,7 +282,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -282,7 +282,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('This would show a map of Mountain View.') content: const Text('This would show a map of Mountain View.')
)); ));
}, },
lines: <String>[ lines: const <String>[
'1600 Amphitheater Parkway', '1600 Amphitheater Parkway',
'Mountain View, CA', 'Mountain View, CA',
'Work', 'Work',
...@@ -296,7 +296,7 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -296,7 +296,7 @@ class ContactsDemoState extends State<ContactsDemo> {
content: const Text('This would also show a map, if this was not a demo.') content: const Text('This would also show a map, if this was not a demo.')
)); ));
}, },
lines: <String>[ lines: const <String>[
'126 Severyns Ave', '126 Severyns Ave',
'Mountain View, CA', 'Mountain View, CA',
'Jet Travel', 'Jet Travel',
...@@ -308,25 +308,25 @@ class ContactsDemoState extends State<ContactsDemo> { ...@@ -308,25 +308,25 @@ class ContactsDemoState extends State<ContactsDemo> {
icon: Icons.today, icon: Icons.today,
children: <Widget>[ children: <Widget>[
new _ContactItem( new _ContactItem(
lines: <String>[ lines: const <String>[
'Birthday', 'Birthday',
'January 9th, 1989', 'January 9th, 1989',
], ],
), ),
new _ContactItem( new _ContactItem(
lines: <String>[ lines: const <String>[
'Wedding anniversary', 'Wedding anniversary',
'June 21st, 2014', 'June 21st, 2014',
], ],
), ),
new _ContactItem( new _ContactItem(
lines: <String>[ lines: const <String>[
'First day in office', 'First day in office',
'January 20th, 2015', 'January 20th, 2015',
], ],
), ),
new _ContactItem( new _ContactItem(
lines: <String>[ lines: const <String>[
'Last day in office', 'Last day in office',
'August 9th, 2015', 'August 9th, 2015',
], ],
......
...@@ -441,7 +441,7 @@ class Tab2Header extends StatelessWidget { ...@@ -441,7 +441,7 @@ class Tab2Header extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 18.0, vertical: 12.0), padding: const EdgeInsets.symmetric(horizontal: 18.0, vertical: 12.0),
child: new Row( child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: const <Widget>[
const Text( const Text(
'SUPPORT TICKET', 'SUPPORT TICKET',
style: const TextStyle( style: const TextStyle(
...@@ -725,10 +725,14 @@ class CupertinoDemoTab3 extends StatelessWidget { ...@@ -725,10 +725,14 @@ class CupertinoDemoTab3 extends StatelessWidget {
child: new SafeArea( child: new SafeArea(
top: false, top: false,
bottom: false, bottom: false,
child: new Row(children: <Widget>[ const Text( child: new Row(
'Sign in', children: const <Widget>[
style: const TextStyle(color: CupertinoColors.activeBlue), const Text(
) ]), 'Sign in',
style: const TextStyle(color: CupertinoColors.activeBlue),
)
],
),
), ),
), ),
), ),
......
...@@ -96,7 +96,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> { ...@@ -96,7 +96,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
), ),
new Row( new Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: const <Widget>[
// Disabled checkboxes // Disabled checkboxes
const Checkbox(value: true, onChanged: null), const Checkbox(value: true, onChanged: null),
const Checkbox(value: false, onChanged: null) const Checkbox(value: false, onChanged: null)
...@@ -136,7 +136,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> { ...@@ -136,7 +136,7 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
// Disabled radio buttons // Disabled radio buttons
new Row( new Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: const <Widget>[
const Radio<int>( const Radio<int>(
value: 0, value: 0,
groupValue: 0, groupValue: 0,
......
...@@ -43,7 +43,7 @@ class _SliderDemoState extends State<SliderDemo> { ...@@ -43,7 +43,7 @@ class _SliderDemoState extends State<SliderDemo> {
), ),
new Column( new Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget> [ children: const <Widget> [
const Slider(value: 0.25, thumbOpenAtMin: true, onChanged: null), const Slider(value: 0.25, thumbOpenAtMin: true, onChanged: null),
const Text('Disabled'), const Text('Disabled'),
] ]
......
...@@ -17,7 +17,7 @@ class TwoLevelListDemo extends StatelessWidget { ...@@ -17,7 +17,7 @@ class TwoLevelListDemo extends StatelessWidget {
new ExpansionTile( new ExpansionTile(
title: const Text('Sublist'), title: const Text('Sublist'),
backgroundColor: Theme.of(context).accentColor.withOpacity(0.025), backgroundColor: Theme.of(context).accentColor.withOpacity(0.025),
children: <Widget>[ children: const <Widget>[
const ListTile(title: const Text('One')), const ListTile(title: const Text('One')),
const ListTile(title: const Text('Two')), const ListTile(title: const Text('Two')),
// https://en.wikipedia.org/wiki/Free_Four // https://en.wikipedia.org/wiki/Free_Four
......
...@@ -362,13 +362,13 @@ class _RecipePageState extends State<RecipePage> { ...@@ -362,13 +362,13 @@ class _RecipePageState extends State<RecipePage> {
], ],
), ),
], ],
flexibleSpace: new FlexibleSpaceBar( flexibleSpace: const FlexibleSpaceBar(
background: new DecoratedBox( background: const DecoratedBox(
decoration: new BoxDecoration( decoration: const BoxDecoration(
gradient: new LinearGradient( gradient: const LinearGradient(
begin: const Alignment(0.0, -1.0), begin: const Alignment(0.0, -1.0),
end: const Alignment(0.0, -0.2), 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 { ...@@ -444,7 +444,7 @@ class RecipeSheet extends StatelessWidget {
child: new Padding( child: new Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0), padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0),
child: new Table( child: new Table(
columnWidths: <int, TableColumnWidth>{ columnWidths: const <int, TableColumnWidth>{
0: const FixedColumnWidth(64.0) 0: const FixedColumnWidth(64.0)
}, },
children: <TableRow>[ children: <TableRow>[
......
...@@ -336,7 +336,7 @@ class _CreateCompanySheet extends StatelessWidget { ...@@ -336,7 +336,7 @@ class _CreateCompanySheet extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Column( return new Column(
children: <Widget>[ children: const <Widget>[
const TextField( const TextField(
autofocus: true, autofocus: true,
decoration: const InputDecoration( decoration: const InputDecoration(
......
...@@ -50,7 +50,7 @@ class _StockSymbolView extends StatelessWidget { ...@@ -50,7 +50,7 @@ class _StockSymbolView extends StatelessWidget {
text: new TextSpan( text: new TextSpan(
style: DefaultTextStyle.of(context).style.merge(const TextStyle(fontSize: 8.0)), style: DefaultTextStyle.of(context).style.merge(const TextStyle(fontSize: 8.0)),
text: 'Prices may be delayed by ', text: 'Prices may be delayed by ',
children: <TextSpan>[ children: const <TextSpan>[
const TextSpan(text: 'several', style: const TextStyle(fontStyle: FontStyle.italic)), const TextSpan(text: 'several', style: const TextStyle(fontStyle: FontStyle.italic)),
const TextSpan(text: ' years.'), const TextSpan(text: ' years.'),
] ]
......
...@@ -20,7 +20,7 @@ void main() { ...@@ -20,7 +20,7 @@ void main() {
testWidgets('Need at least 2 tabs', (WidgetTester tester) async { testWidgets('Need at least 2 tabs', (WidgetTester tester) async {
try { try {
await pumpWidgetWithBoilerplate(tester, new CupertinoTabBar( await pumpWidgetWithBoilerplate(tester, new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
...@@ -38,7 +38,7 @@ void main() { ...@@ -38,7 +38,7 @@ void main() {
await pumpWidgetWithBoilerplate(tester, new MediaQuery( await pumpWidgetWithBoilerplate(tester, new MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: new CupertinoTabBar( child: new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
...@@ -69,7 +69,7 @@ void main() { ...@@ -69,7 +69,7 @@ void main() {
testWidgets('Adjusts height to account for bottom padding', (WidgetTester tester) async { testWidgets('Adjusts height to account for bottom padding', (WidgetTester tester) async {
final CupertinoTabBar tabBar = new CupertinoTabBar( final CupertinoTabBar tabBar = new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Aka'), title: const Text('Aka'),
...@@ -110,7 +110,7 @@ void main() { ...@@ -110,7 +110,7 @@ void main() {
await pumpWidgetWithBoilerplate(tester, new MediaQuery( await pumpWidgetWithBoilerplate(tester, new MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: new CupertinoTabBar( child: new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
...@@ -128,7 +128,7 @@ void main() { ...@@ -128,7 +128,7 @@ void main() {
await pumpWidgetWithBoilerplate(tester, new MediaQuery( await pumpWidgetWithBoilerplate(tester, new MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: new CupertinoTabBar( child: new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
...@@ -151,7 +151,7 @@ void main() { ...@@ -151,7 +151,7 @@ void main() {
await pumpWidgetWithBoilerplate(tester, new MediaQuery( await pumpWidgetWithBoilerplate(tester, new MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: new CupertinoTabBar( child: new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
......
...@@ -77,7 +77,7 @@ void main() { ...@@ -77,7 +77,7 @@ void main() {
testWidgets('test iOS page transition (RTL)', (WidgetTester tester) async { testWidgets('test iOS page transition (RTL)', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
new WidgetsApp( new WidgetsApp(
localizationsDelegates: <LocalizationsDelegate<dynamic>>[ localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
const RtlOverrideWidgetsDelegate(), const RtlOverrideWidgetsDelegate(),
], ],
color: const Color(0xFFFFFFFF), color: const Color(0xFFFFFFFF),
...@@ -279,7 +279,7 @@ void main() { ...@@ -279,7 +279,7 @@ void main() {
testWidgets('test only edge swipes work (RTL)', (WidgetTester tester) async { testWidgets('test only edge swipes work (RTL)', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
new WidgetsApp( new WidgetsApp(
localizationsDelegates: <LocalizationsDelegate<dynamic>>[ localizationsDelegates: const <LocalizationsDelegate<dynamic>>[
const RtlOverrideWidgetsDelegate(), const RtlOverrideWidgetsDelegate(),
], ],
color: const Color(0xFFFFFFFF), color: const Color(0xFFFFFFFF),
......
...@@ -46,7 +46,7 @@ void main() { ...@@ -46,7 +46,7 @@ void main() {
return new CupertinoTabScaffold( return new CupertinoTabScaffold(
tabBar: new CupertinoTabBar( tabBar: new CupertinoTabBar(
backgroundColor: CupertinoColors.white, backgroundColor: CupertinoColors.white,
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
...@@ -94,7 +94,7 @@ void main() { ...@@ -94,7 +94,7 @@ void main() {
), ),
child: new CupertinoTabScaffold( child: new CupertinoTabScaffold(
tabBar: new CupertinoTabBar( tabBar: new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
...@@ -150,7 +150,7 @@ void main() { ...@@ -150,7 +150,7 @@ void main() {
builder: (BuildContext context) { builder: (BuildContext context) {
return new CupertinoTabScaffold( return new CupertinoTabScaffold(
tabBar: new CupertinoTabBar( tabBar: new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
......
...@@ -123,7 +123,7 @@ void main() { ...@@ -123,7 +123,7 @@ void main() {
CupertinoTabBar _buildTabBar() { CupertinoTabBar _buildTabBar() {
return new CupertinoTabBar( return new CupertinoTabBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const ImageIcon(const TestImageProvider(24, 24)), icon: const ImageIcon(const TestImageProvider(24, 24)),
title: const Text('Tab 1'), title: const Text('Tab 1'),
......
...@@ -19,12 +19,12 @@ void main() { ...@@ -19,12 +19,12 @@ void main() {
), ),
drawer: new Drawer( drawer: new Drawer(
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
new AboutListTile( const AboutListTile(
applicationVersion: '0.1.2', applicationVersion: '0.1.2',
applicationIcon: const FlutterLogo(), applicationIcon: const FlutterLogo(),
applicationLegalese: 'I am the very model of a modern major general.', applicationLegalese: 'I am the very model of a modern major general.',
aboutBoxChildren: <Widget>[ aboutBoxChildren: const <Widget>[
const Text('About box'), const Text('About box'),
] ]
), ),
......
...@@ -109,7 +109,7 @@ void main() { ...@@ -109,7 +109,7 @@ void main() {
home: new Scaffold( home: new Scaffold(
appBar: new AppBar( appBar: new AppBar(
title: const Text('X'), title: const Text('X'),
actions: <Widget>[ actions: const <Widget>[
const Icon(Icons.thumb_up), const Icon(Icons.thumb_up),
], ],
), ),
...@@ -130,7 +130,7 @@ void main() { ...@@ -130,7 +130,7 @@ void main() {
home: new Scaffold( home: new Scaffold(
appBar: new AppBar( appBar: new AppBar(
title: const Text('X'), title: const Text('X'),
actions: <Widget>[ actions: const <Widget>[
const Icon(Icons.thumb_up), const Icon(Icons.thumb_up),
const Icon(Icons.thumb_up), const Icon(Icons.thumb_up),
], ],
...@@ -458,7 +458,7 @@ void main() { ...@@ -458,7 +458,7 @@ void main() {
child: new AppBar( child: new AppBar(
leading: const Text('L'), leading: const Text('L'),
title: const Text('No Scaffold'), title: const Text('No Scaffold'),
actions: <Widget>[const Text('A1'), const Text('A2')], actions: const <Widget>[const Text('A1'), const Text('A2')],
), ),
), ),
), ),
...@@ -548,7 +548,7 @@ void main() { ...@@ -548,7 +548,7 @@ void main() {
home: new Scaffold( home: new Scaffold(
appBar: new AppBar( appBar: new AppBar(
title: const Text('X'), title: const Text('X'),
actions: <Widget> [ actions: const <Widget> [
const IconButton( const IconButton(
icon: const Icon(Icons.share), icon: const Icon(Icons.share),
onPressed: null, onPressed: null,
...@@ -977,7 +977,7 @@ void main() { ...@@ -977,7 +977,7 @@ void main() {
child: new AppBar( child: new AppBar(
leading: new Placeholder(key: key), leading: new Placeholder(key: key),
title: const Text('Abc'), title: const Text('Abc'),
actions: <Widget>[ actions: const <Widget>[
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
...@@ -998,7 +998,7 @@ void main() { ...@@ -998,7 +998,7 @@ void main() {
child: new AppBar( child: new AppBar(
leading: new Placeholder(key: key), leading: new Placeholder(key: key),
title: const Text('Abc'), title: const Text('Abc'),
actions: <Widget>[ actions: const <Widget>[
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
...@@ -1028,7 +1028,7 @@ void main() { ...@@ -1028,7 +1028,7 @@ void main() {
child: new AppBar( child: new AppBar(
leading: new Placeholder(key: key), leading: new Placeholder(key: key),
title: const Text('Abc'), title: const Text('Abc'),
actions: <Widget>[ actions: const <Widget>[
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
...@@ -1069,7 +1069,7 @@ void main() { ...@@ -1069,7 +1069,7 @@ void main() {
child: new AppBar( child: new AppBar(
leading: new Placeholder(key: key), leading: new Placeholder(key: key),
title: const Text('Abc'), title: const Text('Abc'),
actions: <Widget>[ actions: const <Widget>[
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0),
......
...@@ -16,7 +16,7 @@ void main() { ...@@ -16,7 +16,7 @@ void main() {
new MaterialApp( new MaterialApp(
home: new Scaffold( home: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
title: const Text('AC') title: const Text('AC')
...@@ -44,7 +44,7 @@ void main() { ...@@ -44,7 +44,7 @@ void main() {
new MaterialApp( new MaterialApp(
home: new Scaffold( home: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
title: const Text('AC') title: const Text('AC')
...@@ -72,7 +72,7 @@ void main() { ...@@ -72,7 +72,7 @@ void main() {
data: const MediaQueryData(padding: const EdgeInsets.only(bottom: 40.0)), data: const MediaQueryData(padding: const EdgeInsets.only(bottom: 40.0)),
child: new Scaffold( child: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
title: const Text('AC') title: const Text('AC')
...@@ -100,7 +100,7 @@ void main() { ...@@ -100,7 +100,7 @@ void main() {
home: new Scaffold( home: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
title: const Text('AC') title: const Text('AC')
...@@ -126,7 +126,7 @@ void main() { ...@@ -126,7 +126,7 @@ void main() {
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
currentIndex: 1, currentIndex: 1,
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
title: const Text('AC') title: const Text('AC')
...@@ -155,7 +155,7 @@ void main() { ...@@ -155,7 +155,7 @@ void main() {
home: new Scaffold( home: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
title: const Text('AC') title: const Text('AC')
...@@ -216,7 +216,7 @@ void main() { ...@@ -216,7 +216,7 @@ void main() {
child: new Scaffold( child: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
title: const Text('AC') title: const Text('AC')
...@@ -254,7 +254,7 @@ void main() { ...@@ -254,7 +254,7 @@ void main() {
child: new Scaffold( child: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
title: const Text('AC') title: const Text('AC')
...@@ -326,7 +326,7 @@ void main() { ...@@ -326,7 +326,7 @@ void main() {
home: new Scaffold( home: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
title: const Text('A'), title: const Text('A'),
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
...@@ -349,7 +349,7 @@ void main() { ...@@ -349,7 +349,7 @@ void main() {
home: new Scaffold( home: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
title: const Text('A'), title: const Text('A'),
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
...@@ -373,7 +373,7 @@ void main() { ...@@ -373,7 +373,7 @@ void main() {
data: const MediaQueryData(textScaleFactor: 2.0), data: const MediaQueryData(textScaleFactor: 2.0),
child: new Scaffold( child: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
title: const Text('A'), title: const Text('A'),
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
...@@ -430,7 +430,7 @@ void main() { ...@@ -430,7 +430,7 @@ void main() {
boilerplate( boilerplate(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
title: const Text('A'), title: const Text('A'),
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
...@@ -462,7 +462,7 @@ void main() { ...@@ -462,7 +462,7 @@ void main() {
boilerplate( boilerplate(
textDirection: TextDirection.rtl, textDirection: TextDirection.rtl,
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[ items: const <BottomNavigationBarItem>[
const BottomNavigationBarItem( const BottomNavigationBarItem(
title: const Text('A'), title: const Text('A'),
icon: const Icon(Icons.ac_unit), icon: const Icon(Icons.ac_unit),
......
...@@ -274,7 +274,7 @@ void main() { ...@@ -274,7 +274,7 @@ void main() {
new MaterialApp( new MaterialApp(
home: new Material( home: new Material(
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const Chip( const Chip(
avatar: const CircleAvatar( avatar: const CircleAvatar(
child: const Text('A') child: const Text('A')
...@@ -318,7 +318,7 @@ void main() { ...@@ -318,7 +318,7 @@ void main() {
data: const MediaQueryData(textScaleFactor: 3.0), data: const MediaQueryData(textScaleFactor: 3.0),
child: new Material( child: new Material(
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const Chip( const Chip(
avatar: const CircleAvatar( avatar: const CircleAvatar(
child: const Text('A') child: const Text('A')
...@@ -352,7 +352,7 @@ void main() { ...@@ -352,7 +352,7 @@ void main() {
new MaterialApp( new MaterialApp(
home: new Material( home: new Material(
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const Chip( const Chip(
avatar: const CircleAvatar( avatar: const CircleAvatar(
child: const Text('A') child: const Text('A')
......
...@@ -71,10 +71,10 @@ void main() { ...@@ -71,10 +71,10 @@ void main() {
onPressed: () { onPressed: () {
showDialog<Null>( showDialog<Null>(
context: context, context: context,
child: new AlertDialog( child: const AlertDialog(
title: const Text('Title'), title: const Text('Title'),
content: const Text('Y'), content: const Text('Y'),
actions: <Widget>[ ], actions: const <Widget>[ ],
), ),
); );
}, },
......
...@@ -53,7 +53,7 @@ void main() { ...@@ -53,7 +53,7 @@ void main() {
new ExpansionTile( new ExpansionTile(
key: defaultKey, key: defaultKey,
title: const Text('Default'), title: const Text('Default'),
children: <Widget>[ children: const <Widget>[
const ListTile(title: const Text('0')), const ListTile(title: const Text('0')),
] ]
) )
......
...@@ -337,7 +337,7 @@ void main() { ...@@ -337,7 +337,7 @@ void main() {
child: new MediaQuery( child: new MediaQuery(
data: const MediaQueryData(), data: const MediaQueryData(),
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const ListTile( const ListTile(
title: const Text('one'), title: const Text('one'),
), ),
......
...@@ -29,7 +29,7 @@ Widget buildFrame(TabController tabController, { Color color, Color selectedColo ...@@ -29,7 +29,7 @@ Widget buildFrame(TabController tabController, { Color color, Color selectedColo
new Flexible( new Flexible(
child: new TabBarView( child: new TabBarView(
controller: tabController, controller: tabController,
children: <Widget>[ children: const <Widget>[
const Center(child: const Text('0')), const Center(child: const Text('0')),
const Center(child: const Text('1')), const Center(child: const Text('1')),
const Center(child: const Text('2')), const Center(child: const Text('2')),
......
...@@ -52,7 +52,7 @@ void main() { ...@@ -52,7 +52,7 @@ void main() {
header: const Text('Test table'), header: const Text('Test table'),
source: source, source: source,
rowsPerPage: 2, rowsPerPage: 2,
availableRowsPerPage: <int>[ availableRowsPerPage: const <int>[
2, 4, 8, 16, 2, 4, 8, 16,
], ],
onRowsPerPageChanged: (int rowsPerPage) { onRowsPerPageChanged: (int rowsPerPage) {
...@@ -61,7 +61,7 @@ void main() { ...@@ -61,7 +61,7 @@ void main() {
onPageChanged: (int rowIndex) { onPageChanged: (int rowIndex) {
log.add('page-changed: $rowIndex'); log.add('page-changed: $rowIndex');
}, },
columns: <DataColumn>[ columns: const <DataColumn>[
const DataColumn(label: const Text('Name')), const DataColumn(label: const Text('Name')),
const DataColumn(label: const Text('Calories'), numeric: true), const DataColumn(label: const Text('Calories'), numeric: true),
const DataColumn(label: const Text('Generation')), const DataColumn(label: const Text('Generation')),
...@@ -199,11 +199,11 @@ void main() { ...@@ -199,11 +199,11 @@ void main() {
header: const Text('HEADER'), header: const Text('HEADER'),
source: new TestDataSource(), source: new TestDataSource(),
rowsPerPage: 8, rowsPerPage: 8,
availableRowsPerPage: <int>[ availableRowsPerPage: const <int>[
8, 9, 8, 9,
], ],
onRowsPerPageChanged: (int rowsPerPage) { }, onRowsPerPageChanged: (int rowsPerPage) { },
columns: <DataColumn>[ columns: const <DataColumn>[
const DataColumn(label: const Text('COL1')), const DataColumn(label: const Text('COL1')),
const DataColumn(label: const Text('COL2')), const DataColumn(label: const Text('COL2')),
const DataColumn(label: const Text('COL3')), const DataColumn(label: const Text('COL3')),
...@@ -226,9 +226,9 @@ void main() { ...@@ -226,9 +226,9 @@ void main() {
header: const Text('HEADER'), header: const Text('HEADER'),
source: source, source: source,
rowsPerPage: 501, rowsPerPage: 501,
availableRowsPerPage: <int>[ 501 ], availableRowsPerPage: const <int>[ 501 ],
onRowsPerPageChanged: (int rowsPerPage) { }, onRowsPerPageChanged: (int rowsPerPage) { },
columns: <DataColumn>[ columns: const <DataColumn>[
const DataColumn(label: const Text('COL1')), const DataColumn(label: const Text('COL1')),
const DataColumn(label: const Text('COL2')), const DataColumn(label: const Text('COL2')),
const DataColumn(label: const Text('COL3')), const DataColumn(label: const Text('COL3')),
...@@ -257,9 +257,9 @@ void main() { ...@@ -257,9 +257,9 @@ void main() {
header: const Text('HEADER'), header: const Text('HEADER'),
source: source, source: source,
rowsPerPage: 5, rowsPerPage: 5,
availableRowsPerPage: <int>[ 5 ], availableRowsPerPage: const <int>[ 5 ],
onRowsPerPageChanged: (int rowsPerPage) { }, onRowsPerPageChanged: (int rowsPerPage) { },
columns: <DataColumn>[ columns: const <DataColumn>[
const DataColumn(label: const Text('COL1')), const DataColumn(label: const Text('COL1')),
const DataColumn(label: const Text('COL2')), const DataColumn(label: const Text('COL2')),
const DataColumn(label: const Text('COL3')), const DataColumn(label: const Text('COL3')),
......
...@@ -187,12 +187,12 @@ void main() { ...@@ -187,12 +187,12 @@ void main() {
testWidgets('LinearProgressIndicator causes a repaint when it changes', (WidgetTester tester) async { testWidgets('LinearProgressIndicator causes a repaint when it changes', (WidgetTester tester) async {
await tester.pumpWidget(new Directionality( await tester.pumpWidget(new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView(children: <Widget>[const LinearProgressIndicator(value: 0.0)]), child: new ListView(children: const <Widget>[const LinearProgressIndicator(value: 0.0)]),
)); ));
final List<Layer> layers1 = tester.layers; final List<Layer> layers1 = tester.layers;
await tester.pumpWidget(new Directionality( await tester.pumpWidget(new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView(children: <Widget>[const LinearProgressIndicator(value: 0.5)])), child: new ListView(children: const <Widget>[const LinearProgressIndicator(value: 0.5)])),
); );
final List<Layer> layers2 = tester.layers; final List<Layer> layers2 = tester.layers;
expect(layers1, isNot(equals(layers2))); expect(layers1, isNot(equals(layers2)));
......
...@@ -72,21 +72,21 @@ void main() { ...@@ -72,21 +72,21 @@ void main() {
), ),
), ),
); );
await tester.fling(find.text('A'), const Offset(300.0, 0.0), 1000.0); // horizontal fling await tester.fling(find.text('A'), const Offset(300.0, 0.0), 1000.0); // horizontal fling
await tester.pump(); await tester.pump();
await tester.pump(const Duration(seconds: 1)); // finish the scroll animation await tester.pump(const Duration(seconds: 1)); // finish the scroll animation
await tester.pump(const Duration(seconds: 1)); // finish the indicator settle animation await tester.pump(const Duration(seconds: 1)); // finish the indicator settle animation
await tester.pump(const Duration(seconds: 1)); // finish the indicator hide animation await tester.pump(const Duration(seconds: 1)); // finish the indicator hide animation
expect(refreshCalled, false); expect(refreshCalled, false);
await tester.fling(find.text('A'), const Offset(0.0, 300.0), 1000.0); // vertical fling await tester.fling(find.text('A'), const Offset(0.0, 300.0), 1000.0); // vertical fling
await tester.pump(); await tester.pump();
await tester.pump(const Duration(seconds: 1)); // finish the scroll animation await tester.pump(const Duration(seconds: 1)); // finish the scroll animation
await tester.pump(const Duration(seconds: 1)); // finish the indicator settle animation await tester.pump(const Duration(seconds: 1)); // finish the indicator settle animation
await tester.pump(const Duration(seconds: 1)); // finish the indicator hide animation await tester.pump(const Duration(seconds: 1)); // finish the indicator hide animation
expect(refreshCalled, true); expect(refreshCalled, true);
}); });
testWidgets('RefreshIndicator - bottom', (WidgetTester tester) async { testWidgets('RefreshIndicator - bottom', (WidgetTester tester) async {
...@@ -98,7 +98,7 @@ void main() { ...@@ -98,7 +98,7 @@ void main() {
child: new ListView( child: new ListView(
reverse: true, reverse: true,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
child: const Text('X'), child: const Text('X'),
...@@ -125,7 +125,7 @@ void main() { ...@@ -125,7 +125,7 @@ void main() {
onRefresh: holdRefresh, onRefresh: holdRefresh,
child: new ListView( child: new ListView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
child: const Text('X'), child: const Text('X'),
...@@ -152,7 +152,7 @@ void main() { ...@@ -152,7 +152,7 @@ void main() {
child: new ListView( child: new ListView(
reverse: true, reverse: true,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
child: const Text('X'), child: const Text('X'),
...@@ -178,7 +178,7 @@ void main() { ...@@ -178,7 +178,7 @@ void main() {
onRefresh: refresh, onRefresh: refresh,
child: new ListView( child: new ListView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
child: const Text('X'), child: const Text('X'),
...@@ -206,7 +206,7 @@ void main() { ...@@ -206,7 +206,7 @@ void main() {
onRefresh: refresh, onRefresh: refresh,
child: new ListView( child: new ListView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
child: const Text('X'), child: const Text('X'),
...@@ -233,7 +233,7 @@ void main() { ...@@ -233,7 +233,7 @@ void main() {
onRefresh: holdRefresh, // this one never returns onRefresh: holdRefresh, // this one never returns
child: new ListView( child: new ListView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
child: const Text('X'), child: const Text('X'),
...@@ -276,7 +276,7 @@ void main() { ...@@ -276,7 +276,7 @@ void main() {
onRefresh: refresh, onRefresh: refresh,
child: new ListView( child: new ListView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
child: const Text('X'), child: const Text('X'),
...@@ -320,7 +320,7 @@ void main() { ...@@ -320,7 +320,7 @@ void main() {
onRefresh: refresh, onRefresh: refresh,
child: new ListView( child: new ListView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 200.0, height: 200.0,
child: const Text('X'), child: const Text('X'),
......
...@@ -500,9 +500,9 @@ void main() { ...@@ -500,9 +500,9 @@ void main() {
const String drawerLabel = 'I am the reason for this test'; const String drawerLabel = 'I am the reason for this test';
final SemanticsTester semantics = new SemanticsTester(tester); final SemanticsTester semantics = new SemanticsTester(tester);
await tester.pumpWidget(new MaterialApp(home: new Scaffold( await tester.pumpWidget(new MaterialApp(home: const Scaffold(
body: const Text(bodyLabel), body: const Text(bodyLabel),
persistentFooterButtons: <Widget>[const Text(persistentFooterButtonLabel)], persistentFooterButtons: const <Widget>[const Text(persistentFooterButtonLabel)],
bottomNavigationBar: const Text(bottomNavigationBarLabel), bottomNavigationBar: const Text(bottomNavigationBarLabel),
floatingActionButton: const Text(floatingActionButtonLabel), floatingActionButton: const Text(floatingActionButtonLabel),
drawer: const Drawer(child:const Text(drawerLabel)), drawer: const Drawer(child:const Text(drawerLabel)),
......
...@@ -16,7 +16,7 @@ void main() { ...@@ -16,7 +16,7 @@ void main() {
onStepTapped: (int i) { onStepTapped: (int i) {
index = i; index = i;
}, },
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const SizedBox( content: const SizedBox(
...@@ -46,7 +46,7 @@ void main() { ...@@ -46,7 +46,7 @@ void main() {
home: new Center( home: new Center(
child: new Material( child: new Material(
child: new Stepper( child: new Stepper(
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const SizedBox( content: const SizedBox(
...@@ -77,7 +77,7 @@ void main() { ...@@ -77,7 +77,7 @@ void main() {
child: new Material( child: new Material(
child: new Stepper( child: new Stepper(
currentStep: 1, currentStep: 1,
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const SizedBox( content: const SizedBox(
...@@ -114,7 +114,7 @@ void main() { ...@@ -114,7 +114,7 @@ void main() {
child: new Material( child: new Material(
child: new Stepper( child: new Stepper(
type: StepperType.horizontal, type: StepperType.horizontal,
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const SizedBox( content: const SizedBox(
...@@ -139,7 +139,7 @@ void main() { ...@@ -139,7 +139,7 @@ void main() {
home: new Material( home: new Material(
child: new Stepper( child: new Stepper(
type: StepperType.horizontal, type: StepperType.horizontal,
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const Text('A'), content: const Text('A'),
...@@ -163,7 +163,7 @@ void main() { ...@@ -163,7 +163,7 @@ void main() {
child: new Stepper( child: new Stepper(
currentStep: 1, currentStep: 1,
type: StepperType.horizontal, type: StepperType.horizontal,
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const Text('A'), content: const Text('A'),
...@@ -197,7 +197,7 @@ void main() { ...@@ -197,7 +197,7 @@ void main() {
onStepCancel: () { onStepCancel: () {
cancelPressed = true; cancelPressed = true;
}, },
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const SizedBox( content: const SizedBox(
...@@ -235,7 +235,7 @@ void main() { ...@@ -235,7 +235,7 @@ void main() {
onStepTapped: (int i) { onStepTapped: (int i) {
index = i; index = i;
}, },
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const SizedBox( content: const SizedBox(
...@@ -266,7 +266,7 @@ void main() { ...@@ -266,7 +266,7 @@ void main() {
new MaterialApp( new MaterialApp(
home: new Material( home: new Material(
child: new Stepper( child: new Stepper(
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const SizedBox( content: const SizedBox(
...@@ -303,7 +303,7 @@ void main() { ...@@ -303,7 +303,7 @@ void main() {
home: new Material( home: new Material(
child: new Stepper( child: new Stepper(
currentStep: 2, currentStep: 2,
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('Step 1'), title: const Text('Step 1'),
content: const SizedBox( content: const SizedBox(
...@@ -341,7 +341,7 @@ void main() { ...@@ -341,7 +341,7 @@ void main() {
home: new Center( home: new Center(
child: new Material( child: new Material(
child: new Stepper( child: new Stepper(
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('A'), title: const Text('A'),
state: StepState.complete, state: StepState.complete,
...@@ -374,7 +374,7 @@ void main() { ...@@ -374,7 +374,7 @@ void main() {
home: new Center( home: new Center(
child: new Material( child: new Material(
child: new Stepper( child: new Stepper(
steps: <Step>[ steps: const <Step>[
const Step( const Step(
title: const Text('A'), title: const Text('A'),
state: StepState.error, state: StepState.error,
......
...@@ -122,8 +122,8 @@ Widget buildLeftRightApp({ List<String> tabs, String value }) { ...@@ -122,8 +122,8 @@ Widget buildLeftRightApp({ List<String> tabs, String value }) {
tabs: tabs.map((String tab) => new Tab(text: tab)).toList(), tabs: tabs.map((String tab) => new Tab(text: tab)).toList(),
), ),
), ),
body: new TabBarView( body: const TabBarView(
children: <Widget>[ children: const <Widget>[
const Center(child: const Text('LEFT CHILD')), const Center(child: const Text('LEFT CHILD')),
const Center(child: const Text('RIGHT CHILD')) const Center(child: const Text('RIGHT CHILD'))
] ]
...@@ -538,7 +538,7 @@ void main() { ...@@ -538,7 +538,7 @@ void main() {
), ),
body: new TabBarView( body: new TabBarView(
controller: controller, controller: controller,
children: <Widget>[ children: const <Widget>[
const Center(child: const Text('LEFT CHILD')), const Center(child: const Text('LEFT CHILD')),
const Center(child: const Text('RIGHT CHILD')) const Center(child: const Text('RIGHT CHILD'))
] ]
...@@ -597,7 +597,7 @@ void main() { ...@@ -597,7 +597,7 @@ void main() {
), ),
body: new TabBarView( body: new TabBarView(
controller: controller, controller: controller,
children: <Widget>[ children: const <Widget>[
const Center(child: const Text('CHILD A')), const Center(child: const Text('CHILD A')),
const Center(child: const Text('CHILD B')), const Center(child: const Text('CHILD B')),
const Center(child: const Text('CHILD C')), const Center(child: const Text('CHILD C')),
...@@ -690,7 +690,7 @@ void main() { ...@@ -690,7 +690,7 @@ void main() {
boilerplate( boilerplate(
child: new TabBarView( child: new TabBarView(
controller: controller, controller: controller,
children: <Widget>[ const Text('First'), const Text('Second') ], children: const <Widget>[ const Text('First'), const Text('Second') ],
), ),
), ),
); );
...@@ -789,7 +789,7 @@ void main() { ...@@ -789,7 +789,7 @@ void main() {
child: new TabBar( child: new TabBar(
key: new UniqueKey(), key: new UniqueKey(),
controller: controller, controller: controller,
tabs: <Widget>[ const Text('A'), const Text('B') ], tabs: const <Widget>[ const Text('A'), const Text('B') ],
), ),
); );
} }
...@@ -822,7 +822,7 @@ void main() { ...@@ -822,7 +822,7 @@ void main() {
height: 400.0, height: 400.0,
child: new TabBarView( child: new TabBarView(
controller: tabController, controller: tabController,
children: <Widget>[ children: const <Widget>[
const Center(child: const Text('0')), const Center(child: const Text('0')),
const Center(child: const Text('1')), const Center(child: const Text('1')),
const Center(child: const Text('2')), const Center(child: const Text('2')),
...@@ -870,7 +870,7 @@ void main() { ...@@ -870,7 +870,7 @@ void main() {
child: new TabBarView( child: new TabBarView(
controller: tabController, controller: tabController,
physics: const TestScrollPhysics(), physics: const TestScrollPhysics(),
children: <Widget>[ children: const <Widget>[
const Center(child: const Text('0')), const Center(child: const Text('0')),
const Center(child: const Text('1')), const Center(child: const Text('1')),
const Center(child: const Text('2')), const Center(child: const Text('2')),
......
...@@ -128,7 +128,7 @@ void main() { ...@@ -128,7 +128,7 @@ void main() {
key: dropdownMenuButtonKey, key: dropdownMenuButtonKey,
onChanged: (String newValue) { }, onChanged: (String newValue) { },
value: 'menuItem', value: 'menuItem',
items: <DropdownMenuItem<String>>[ items: const <DropdownMenuItem<String>>[
const DropdownMenuItem<String>( const DropdownMenuItem<String>(
value: 'menuItem', value: 'menuItem',
child: const Text('menuItem'), child: const Text('menuItem'),
......
...@@ -22,7 +22,7 @@ void main() { ...@@ -22,7 +22,7 @@ void main() {
new ExpansionTile( new ExpansionTile(
key: sublistKey, key: sublistKey,
title: const Text('Sublist'), title: const Text('Sublist'),
children: <Widget>[ children: const <Widget>[
const ListTile(title: const Text('0')), const ListTile(title: const Text('0')),
const ListTile(title: const Text('1')) const ListTile(title: const Text('1'))
] ]
...@@ -81,7 +81,7 @@ void main() { ...@@ -81,7 +81,7 @@ void main() {
onExpansionChanged: (bool opened) { onExpansionChanged: (bool opened) {
didChangeOpen = opened; didChangeOpen = opened;
}, },
children: <Widget>[ children: const <Widget>[
const ListTile(title: const Text('0')), const ListTile(title: const Text('0')),
const ListTile(title: const Text('1')) const ListTile(title: const Text('1'))
] ]
...@@ -110,11 +110,11 @@ void main() { ...@@ -110,11 +110,11 @@ void main() {
return new Material( return new Material(
child: new SingleChildScrollView( child: new SingleChildScrollView(
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const ListTile(title: const Text('Top')), const ListTile(title: const Text('Top')),
new ExpansionTile( const ExpansionTile(
title: const Text('Sublist'), title: const Text('Sublist'),
children: <Widget>[ children: const <Widget>[
const ListTile(title: const Text('0')), const ListTile(title: const Text('0')),
const ListTile(title: const Text('1')) const ListTile(title: const Text('1'))
], ],
......
...@@ -40,7 +40,7 @@ Future<Null> pumpTestWidget(WidgetTester tester, { ...@@ -40,7 +40,7 @@ Future<Null> pumpTestWidget(WidgetTester tester, {
child: const Text('A'), child: const Text('A'),
), ),
), ),
otherAccountsPictures: <Widget>[ otherAccountsPictures: const <Widget>[
const CircleAvatar( const CircleAvatar(
child: const Text('B'), child: const Text('B'),
), ),
......
...@@ -12,7 +12,7 @@ void main() { ...@@ -12,7 +12,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Center( new Center(
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const SizedBox(width: 200.0, height: 200.0), const SizedBox(width: 200.0, height: 200.0),
], ],
), ),
...@@ -26,7 +26,7 @@ void main() { ...@@ -26,7 +26,7 @@ void main() {
child: new SizedBox( child: new SizedBox(
height: 100.0, height: 100.0,
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const SizedBox(width: 200.0, height: 200.0), const SizedBox(width: 200.0, height: 200.0),
], ],
), ),
...@@ -43,7 +43,7 @@ void main() { ...@@ -43,7 +43,7 @@ void main() {
child: new SizedBox( child: new SizedBox(
height: 0.0, height: 0.0,
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const SizedBox(width: 200.0, height: 200.0), const SizedBox(width: 200.0, height: 200.0),
], ],
), ),
......
...@@ -11,7 +11,7 @@ const String kTitleString = 'Hello World'; ...@@ -11,7 +11,7 @@ const String kTitleString = 'Hello World';
Future<Null> pumpApp(WidgetTester tester, { GenerateAppTitle onGenerateTitle }) async { Future<Null> pumpApp(WidgetTester tester, { GenerateAppTitle onGenerateTitle }) async {
await tester.pumpWidget( await tester.pumpWidget(
new WidgetsApp( new WidgetsApp(
supportedLocales: <Locale>[ supportedLocales: const <Locale>[
const Locale('en', 'US'), const Locale('en', 'US'),
const Locale('en', 'GB'), const Locale('en', 'GB'),
], ],
......
...@@ -221,7 +221,7 @@ void main() { ...@@ -221,7 +221,7 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(0), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(0), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()),
]), ]),
...@@ -297,7 +297,7 @@ void main() { ...@@ -297,7 +297,7 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(0), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(0), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()),
]), ]),
...@@ -306,7 +306,7 @@ void main() { ...@@ -306,7 +306,7 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(3), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(3), child: const Placeholder()),
]), ]),
...@@ -315,7 +315,7 @@ void main() { ...@@ -315,7 +315,7 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(4), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(4), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(5), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(5), child: const Placeholder()),
]), ]),
...@@ -349,7 +349,7 @@ void main() { ...@@ -349,7 +349,7 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()),
]), ]),
), ),
...@@ -357,7 +357,7 @@ void main() { ...@@ -357,7 +357,7 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(3), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(3), child: const Placeholder()),
]), ]),
...@@ -366,7 +366,7 @@ void main() { ...@@ -366,7 +366,7 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(4), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(4), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(5), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(5), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(0), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(0), child: const Placeholder()),
...@@ -408,7 +408,7 @@ void main() { ...@@ -408,7 +408,7 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()),
]), ]),
...@@ -417,14 +417,14 @@ void main() { ...@@ -417,14 +417,14 @@ void main() {
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
]), ]),
), ),
), ),
new AutomaticKeepAlive( new AutomaticKeepAlive(
child: new Container( child: new Container(
height: 400.0, height: 400.0,
child: new Stack(children: <Widget>[ child: new Stack(children: const <Widget>[
const Leaf(key: const GlobalObjectKey<_LeafState>(3), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(3), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(4), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(4), child: const Placeholder()),
const Leaf(key: const GlobalObjectKey<_LeafState>(5), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(5), child: const Placeholder()),
......
...@@ -21,7 +21,7 @@ void main() { ...@@ -21,7 +21,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Row( new Row(
children: <Widget>[ children: const <Widget>[
const SliverList( const SliverList(
delegate: const SliverChildListDelegate(const <Widget>[]), delegate: const SliverChildListDelegate(const <Widget>[]),
), ),
...@@ -37,7 +37,7 @@ void main() { ...@@ -37,7 +37,7 @@ void main() {
new Viewport( new Viewport(
crossAxisDirection: AxisDirection.right, crossAxisDirection: AxisDirection.right,
offset: new ViewportOffset.zero(), offset: new ViewportOffset.zero(),
slivers: <Widget>[ slivers: const <Widget>[
const SizedBox(), const SizedBox(),
], ],
), ),
...@@ -49,7 +49,7 @@ void main() { ...@@ -49,7 +49,7 @@ void main() {
new Viewport( new Viewport(
crossAxisDirection: AxisDirection.right, crossAxisDirection: AxisDirection.right,
offset: new ViewportOffset.zero(), offset: new ViewportOffset.zero(),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding( const SliverPadding(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
sliver: const SizedBox(), sliver: const SizedBox(),
......
...@@ -10,7 +10,7 @@ void main() { ...@@ -10,7 +10,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView(children: <Widget>[const Center()]) child: new ListView(children: const <Widget>[const Center()])
), ),
); );
}); });
......
...@@ -518,7 +518,7 @@ void main() { ...@@ -518,7 +518,7 @@ void main() {
width: 100.0, width: 100.0,
height: 1000.0, height: 1000.0,
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const Test1215DismissibleWidget('1'), const Test1215DismissibleWidget('1'),
const Test1215DismissibleWidget('2'), const Test1215DismissibleWidget('2'),
], ],
......
...@@ -1224,7 +1224,7 @@ void main() { ...@@ -1224,7 +1224,7 @@ void main() {
await tester.pumpWidget(new MaterialApp( await tester.pumpWidget(new MaterialApp(
home: new Column( home: new Column(
children: <Widget>[ children: const <Widget>[
const Draggable<int>( const Draggable<int>(
data: 1, data: 1,
child: const Text('Source'), child: const Text('Source'),
......
...@@ -51,7 +51,7 @@ void main() { ...@@ -51,7 +51,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Row( new Row(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: <Widget>[ children: const <Widget>[
const Flexible(child: const SizedBox(width: 100.0, height: 200.0)), const Flexible(child: const SizedBox(width: 100.0, height: 200.0)),
], ],
), ),
...@@ -65,7 +65,7 @@ void main() { ...@@ -65,7 +65,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Row( new Row(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: <Widget>[ children: const <Widget>[
const Expanded(flex: null, child: const Text('one', textDirection: TextDirection.ltr)), const Expanded(flex: null, child: const Text('one', textDirection: TextDirection.ltr)),
const Flexible(flex: null, child: const Text('two', textDirection: TextDirection.ltr)), const Flexible(flex: null, child: const Text('two', textDirection: TextDirection.ltr)),
], ],
......
...@@ -58,7 +58,7 @@ void main() { ...@@ -58,7 +58,7 @@ void main() {
testWidgets('Can have multiple focused children and they update accordingly', (WidgetTester tester) async { testWidgets('Can have multiple focused children and they update accordingly', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
new Column( new Column(
children: <Widget>[ children: const <Widget>[
const TestFocusable( const TestFocusable(
no: 'a', no: 'a',
yes: 'A FOCUSED', yes: 'A FOCUSED',
...@@ -146,7 +146,7 @@ void main() { ...@@ -146,7 +146,7 @@ void main() {
autofocus: true, autofocus: true,
child: new Row( child: new Row(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: <Widget>[ children: const <Widget>[
const TestFocusable( const TestFocusable(
no: 'a', no: 'a',
yes: 'A FOCUSED', yes: 'A FOCUSED',
...@@ -221,7 +221,7 @@ void main() { ...@@ -221,7 +221,7 @@ void main() {
node: parentFocusScope, node: parentFocusScope,
child: new Row( child: new Row(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: <Widget>[ children: const <Widget>[
const TestFocusable( const TestFocusable(
no: 'a', no: 'a',
yes: 'A FOCUSED', yes: 'A FOCUSED',
......
...@@ -22,7 +22,7 @@ void main() { ...@@ -22,7 +22,7 @@ void main() {
}); });
await tester.pumpWidget(new Image.network( await tester.pumpWidget(new Image.network(
'https://www.example.com/images/frame.png', 'https://www.example.com/images/frame.png',
headers: <String, String>{'flutter': 'flutter'}, headers: const <String, String>{'flutter': 'flutter'},
)); ));
}); });
} }
...@@ -22,7 +22,7 @@ void main() { ...@@ -22,7 +22,7 @@ void main() {
container: true, container: true,
explicitChildNodes: false, explicitChildNodes: false,
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const Text('Michael Goderbauer'), const Text('Michael Goderbauer'),
const Text('goderbauer@google.com'), const Text('goderbauer@google.com'),
], ],
...@@ -56,7 +56,7 @@ void main() { ...@@ -56,7 +56,7 @@ void main() {
container: true, container: true,
explicitChildNodes: true, explicitChildNodes: true,
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const Text('Michael Goderbauer'), const Text('Michael Goderbauer'),
const Text('goderbauer@google.com'), const Text('goderbauer@google.com'),
], ],
...@@ -103,7 +103,7 @@ void main() { ...@@ -103,7 +103,7 @@ void main() {
child: new Semantics( child: new Semantics(
label: 'Signed in as', label: 'Signed in as',
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const Text('Michael Goderbauer'), const Text('Michael Goderbauer'),
const Text('goderbauer@google.com'), const Text('goderbauer@google.com'),
], ],
...@@ -146,7 +146,7 @@ void main() { ...@@ -146,7 +146,7 @@ void main() {
child: new Semantics( child: new Semantics(
label: 'Signed in as', label: 'Signed in as',
child: new Column( child: new Column(
children: <Widget>[ children: const <Widget>[
const Text('Michael Goderbauer'), const Text('Michael Goderbauer'),
const Text('goderbauer@google.com'), const Text('goderbauer@google.com'),
], ],
......
...@@ -120,7 +120,7 @@ void main() { ...@@ -120,7 +120,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
controller: controller, controller: controller,
children: <Widget>[const Text('A'), const Text('B'), const Text('C')], children: const <Widget>[const Text('A'), const Text('B'), const Text('C')],
), ),
); );
} }
...@@ -178,7 +178,7 @@ void main() { ...@@ -178,7 +178,7 @@ void main() {
new Flexible( new Flexible(
// The overall height of the ListView's contents is 500 // The overall height of the ListView's contents is 500
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox( const SizedBox(
height: 150.0, height: 150.0,
child: const Center( child: const Center(
......
...@@ -16,7 +16,7 @@ void main() { ...@@ -16,7 +16,7 @@ void main() {
children: <Widget>[ children: <Widget>[
new ListView( new ListView(
shrinkWrap: true, shrinkWrap: true,
children: <Widget>[ children: const <Widget>[
const Text('1'), const Text('1'),
const Text('2'), const Text('2'),
const Text('3'), const Text('3'),
...@@ -24,7 +24,7 @@ void main() { ...@@ -24,7 +24,7 @@ void main() {
), ),
new ListView( new ListView(
shrinkWrap: true, shrinkWrap: true,
children: <Widget>[ children: const <Widget>[
const Text('4'), const Text('4'),
const Text('5'), const Text('5'),
const Text('6'), const Text('6'),
...@@ -43,7 +43,7 @@ void main() { ...@@ -43,7 +43,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 100.0, child: const Text('100')),
], ],
), ),
...@@ -54,7 +54,7 @@ void main() { ...@@ -54,7 +54,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 100.0, child: const Text('100')),
const SizedBox(height: 200.0, child: const Text('200')), const SizedBox(height: 200.0, child: const Text('200')),
], ],
...@@ -70,7 +70,7 @@ void main() { ...@@ -70,7 +70,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 100.0, child: const Text('100')),
], ],
), ),
...@@ -84,7 +84,7 @@ void main() { ...@@ -84,7 +84,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 100.0, child: const Text('100')),
const SizedBox(height: 200.0, child: const Text('200')), const SizedBox(height: 200.0, child: const Text('200')),
], ],
...@@ -97,7 +97,7 @@ void main() { ...@@ -97,7 +97,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[] children: const <Widget>[]
), ),
), ),
); );
...@@ -109,7 +109,7 @@ void main() { ...@@ -109,7 +109,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 300.0, child: const Text('300')), const SizedBox(height: 300.0, child: const Text('300')),
const SizedBox(height: 400.0, child: const Text('400')), const SizedBox(height: 400.0, child: const Text('400')),
], ],
...@@ -124,7 +124,7 @@ void main() { ...@@ -124,7 +124,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 300.0, child: const Text('300')), const SizedBox(height: 300.0, child: const Text('300')),
], ],
), ),
...@@ -138,7 +138,7 @@ void main() { ...@@ -138,7 +138,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[] children: const <Widget>[]
), ),
), ),
); );
...@@ -152,7 +152,7 @@ void main() { ...@@ -152,7 +152,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 300.0, child: const Text('300')), const SizedBox(height: 300.0, child: const Text('300')),
const SizedBox(height: 400.0, child: const Text('400')), const SizedBox(height: 400.0, child: const Text('400')),
], ],
...@@ -167,7 +167,7 @@ void main() { ...@@ -167,7 +167,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 300.0, child: const Text('300')), const SizedBox(height: 300.0, child: const Text('300')),
const SizedBox(height: 400.0, child: const Text('400')), const SizedBox(height: 400.0, child: const Text('400')),
const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 100.0, child: const Text('100')),
...@@ -191,7 +191,7 @@ void main() { ...@@ -191,7 +191,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 100.0, child: const Text('100')),
], ],
), ),
...@@ -205,7 +205,7 @@ void main() { ...@@ -205,7 +205,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new ListView( child: new ListView(
children: <Widget>[ children: const <Widget>[
const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 100.0, child: const Text('100')),
const SizedBox(height: 200.0, child: const Text('200')), const SizedBox(height: 200.0, child: const Text('200')),
const SizedBox(height: 400.0, child: const Text('400')), const SizedBox(height: 400.0, child: const Text('400')),
......
...@@ -188,7 +188,7 @@ void main() { ...@@ -188,7 +188,7 @@ void main() {
height: 0.0, height: 0.0,
child: new ListView( child: new ListView(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
children: <Widget>[ children: const <Widget>[
const Text('padded', textDirection: TextDirection.ltr), const Text('padded', textDirection: TextDirection.ltr),
], ],
), ),
......
...@@ -27,7 +27,7 @@ void main() { ...@@ -27,7 +27,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new CustomScrollView( child: new CustomScrollView(
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
], ],
), ),
...@@ -57,7 +57,7 @@ void main() { ...@@ -57,7 +57,7 @@ void main() {
await tester.pumpAndSettle(const Duration(seconds: 1)); await tester.pumpAndSettle(const Duration(seconds: 1));
expect(painter, doesNotOverscroll); expect(painter, doesNotOverscroll);
}); });
testWidgets('Nested scrollable', (WidgetTester tester) async { testWidgets('Nested scrollable', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
new Directionality( new Directionality(
...@@ -71,7 +71,7 @@ void main() { ...@@ -71,7 +71,7 @@ void main() {
child: new Container( child: new Container(
width: 600.0, width: 600.0,
child: new CustomScrollView( child: new CustomScrollView(
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
], ],
), ),
...@@ -80,21 +80,21 @@ void main() { ...@@ -80,21 +80,21 @@ void main() {
), ),
), ),
); );
final RenderObject outerPainter = tester.renderObject(find.byType(CustomPaint).first); final RenderObject outerPainter = tester.renderObject(find.byType(CustomPaint).first);
final RenderObject innerPainter = tester.renderObject(find.byType(CustomPaint).last); final RenderObject innerPainter = tester.renderObject(find.byType(CustomPaint).last);
await slowDrag(tester, const Offset(200.0, 200.0), const Offset(0.0, 5.0)); await slowDrag(tester, const Offset(200.0, 200.0), const Offset(0.0, 5.0));
expect(outerPainter, paints..circle()); expect(outerPainter, paints..circle());
expect(innerPainter, paints..circle()); expect(innerPainter, paints..circle());
}); });
testWidgets('Overscroll indicator changes side when you drag on the other side', (WidgetTester tester) async { testWidgets('Overscroll indicator changes side when you drag on the other side', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new CustomScrollView( child: new CustomScrollView(
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
], ],
), ),
...@@ -132,7 +132,7 @@ void main() { ...@@ -132,7 +132,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new CustomScrollView( child: new CustomScrollView(
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
], ],
), ),
...@@ -169,7 +169,7 @@ void main() { ...@@ -169,7 +169,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new CustomScrollView( child: new CustomScrollView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
], ],
), ),
...@@ -190,7 +190,7 @@ void main() { ...@@ -190,7 +190,7 @@ void main() {
child: new CustomScrollView( child: new CustomScrollView(
reverse: true, reverse: true,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
], ],
), ),
...@@ -211,7 +211,7 @@ void main() { ...@@ -211,7 +211,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new CustomScrollView( child: new CustomScrollView(
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
], ],
), ),
...@@ -235,7 +235,7 @@ void main() { ...@@ -235,7 +235,7 @@ void main() {
child: new CustomScrollView( child: new CustomScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
], ],
), ),
...@@ -287,7 +287,7 @@ void main() { ...@@ -287,7 +287,7 @@ void main() {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
reverse: true, reverse: true,
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
], ],
), ),
...@@ -308,7 +308,7 @@ void main() { ...@@ -308,7 +308,7 @@ void main() {
child: new CustomScrollView( child: new CustomScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), const SliverToBoxAdapter(child: const SizedBox(height: 20.0)),
], ],
), ),
......
...@@ -611,7 +611,7 @@ void main() { ...@@ -611,7 +611,7 @@ void main() {
child: new PageView( child: new PageView(
key: const PageStorageKey<String>('PageView'), key: const PageStorageKey<String>('PageView'),
controller: controller, controller: controller,
children: <Widget>[ children: const <Widget>[
const Placeholder(), const Placeholder(),
const Placeholder(), const Placeholder(),
const Placeholder(), const Placeholder(),
...@@ -645,7 +645,7 @@ void main() { ...@@ -645,7 +645,7 @@ void main() {
child: new PageView( child: new PageView(
key: const PageStorageKey<String>('PageView'), key: const PageStorageKey<String>('PageView'),
controller: controller, controller: controller,
children: <Widget>[ children: const <Widget>[
const Placeholder(), const Placeholder(),
const Placeholder(), const Placeholder(),
const Placeholder(), const Placeholder(),
...@@ -663,7 +663,7 @@ void main() { ...@@ -663,7 +663,7 @@ void main() {
child: new PageView( child: new PageView(
key: const PageStorageKey<String>('Check it again against your list and see consistency!'), key: const PageStorageKey<String>('Check it again against your list and see consistency!'),
controller: controller2, controller: controller2,
children: <Widget>[ children: const <Widget>[
const Placeholder(), const Placeholder(),
const Placeholder(), const Placeholder(),
const Placeholder(), const Placeholder(),
......
...@@ -13,11 +13,11 @@ void main() { ...@@ -13,11 +13,11 @@ void main() {
expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(800.0, 600.0)); expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(800.0, 600.0));
await tester.pumpWidget(const Center(child: const Placeholder())); await tester.pumpWidget(const Center(child: const Placeholder()));
expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(800.0, 600.0)); expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(800.0, 600.0));
await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: <Widget>[const Positioned(top: 0.0, bottom: 0.0, child: const Placeholder())])); await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: const <Widget>[const Positioned(top: 0.0, bottom: 0.0, child: const Placeholder())]));
expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(400.0, 600.0)); expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(400.0, 600.0));
await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: <Widget>[const Positioned(left: 0.0, right: 0.0, child: const Placeholder())])); await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: const <Widget>[const Positioned(left: 0.0, right: 0.0, child: const Placeholder())]));
expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(800.0, 400.0)); expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(800.0, 400.0));
await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: <Widget>[const Positioned(top: 0.0, child: const Placeholder(fallbackWidth: 200.0, fallbackHeight: 300.0))])); await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: const <Widget>[const Positioned(top: 0.0, child: const Placeholder(fallbackWidth: 200.0, fallbackHeight: 300.0))]));
expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(200.0, 300.0)); expect(tester.renderObject<RenderBox>(find.byType(Placeholder)).size, const Size(200.0, 300.0));
}); });
......
...@@ -346,7 +346,7 @@ void main() { ...@@ -346,7 +346,7 @@ void main() {
onNotification: (OverscrollNotification message) { scrolled = true; return false; }, onNotification: (OverscrollNotification message) { scrolled = true; return false; },
child: new ListView( child: new ListView(
primary: true, primary: true,
children: <Widget>[], children: const <Widget>[],
), ),
), ),
), ),
...@@ -364,7 +364,7 @@ void main() { ...@@ -364,7 +364,7 @@ void main() {
onNotification: (OverscrollNotification message) { scrolled = true; return false; }, onNotification: (OverscrollNotification message) { scrolled = true; return false; },
child: new ListView( child: new ListView(
primary: false, primary: false,
children: <Widget>[], children: const <Widget>[],
), ),
), ),
), ),
...@@ -383,7 +383,7 @@ void main() { ...@@ -383,7 +383,7 @@ void main() {
child: new ListView( child: new ListView(
primary: false, primary: false,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[], children: const <Widget>[],
), ),
), ),
), ),
...@@ -402,7 +402,7 @@ void main() { ...@@ -402,7 +402,7 @@ void main() {
child: new ListView( child: new ListView(
primary: true, primary: true,
physics: const ScrollPhysics(), physics: const ScrollPhysics(),
children: <Widget>[], children: const <Widget>[],
), ),
), ),
), ),
......
...@@ -12,7 +12,7 @@ Future<Null> pumpTest(WidgetTester tester, TargetPlatform platform) async { ...@@ -12,7 +12,7 @@ Future<Null> pumpTest(WidgetTester tester, TargetPlatform platform) async {
platform: platform, platform: platform,
), ),
home: new CustomScrollView( home: new CustomScrollView(
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)),
], ],
), ),
......
...@@ -8,11 +8,11 @@ import 'package:flutter_test/flutter_test.dart'; ...@@ -8,11 +8,11 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
Shader createShader(Rect bounds) { Shader createShader(Rect bounds) {
return new LinearGradient( return const LinearGradient(
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
colors: <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)], colors: const <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)],
stops: <double>[0.1, 0.35] stops: const <double>[0.1, 0.35]
).createShader(bounds); ).createShader(bounds);
} }
......
...@@ -195,7 +195,7 @@ void main() { ...@@ -195,7 +195,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.zero(), offset: new ViewportOffset.zero(),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter( const SliverToBoxAdapter(
child: const SizedBox(height: 400.0, child: const Text('a')), child: const SizedBox(height: 400.0, child: const Text('a')),
), ),
...@@ -211,7 +211,7 @@ void main() { ...@@ -211,7 +211,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.fixed(100.0), offset: new ViewportOffset.fixed(100.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter( const SliverToBoxAdapter(
child: const SizedBox(height: 400.0, child: const Text('a')), child: const SizedBox(height: 400.0, child: const Text('a')),
), ),
...@@ -227,7 +227,7 @@ void main() { ...@@ -227,7 +227,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.fixed(100.0), offset: new ViewportOffset.fixed(100.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter( const SliverToBoxAdapter(
child: const SizedBox(height: 4000.0, child: const Text('a')), child: const SizedBox(height: 4000.0, child: const Text('a')),
), ),
...@@ -243,7 +243,7 @@ void main() { ...@@ -243,7 +243,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.zero(), offset: new ViewportOffset.zero(),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter( const SliverToBoxAdapter(
child: const SizedBox(height: 4000.0, child: const Text('a')), child: const SizedBox(height: 4000.0, child: const Text('a')),
), ),
......
...@@ -249,7 +249,7 @@ void main() { ...@@ -249,7 +249,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Viewport( child: new Viewport(
offset: new ViewportOffset.fixed(0.0), offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding(padding: const EdgeInsets.all(100.0)), const SliverPadding(padding: const EdgeInsets.all(100.0)),
const SliverToBoxAdapter(child: const SizedBox(width: 400.0, height: 400.0, child: const Text('x'))), const SliverToBoxAdapter(child: const SizedBox(width: 400.0, height: 400.0, child: const Text('x'))),
], ],
...@@ -266,7 +266,7 @@ void main() { ...@@ -266,7 +266,7 @@ void main() {
child: new Viewport( child: new Viewport(
axisDirection: AxisDirection.left, axisDirection: AxisDirection.left,
offset: new ViewportOffset.fixed(0.0), offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding(padding: const EdgeInsets.fromLTRB(90.0, 1.0, 110.0, 2.0)), const SliverPadding(padding: const EdgeInsets.fromLTRB(90.0, 1.0, 110.0, 2.0)),
const SliverToBoxAdapter(child: const SizedBox(width: 201.0, child: const Text('x'))), const SliverToBoxAdapter(child: const SizedBox(width: 201.0, child: const Text('x'))),
], ],
...@@ -280,7 +280,7 @@ void main() { ...@@ -280,7 +280,7 @@ void main() {
child: new Viewport( child: new Viewport(
axisDirection: AxisDirection.left, axisDirection: AxisDirection.left,
offset: new ViewportOffset.fixed(0.0), offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding(padding: const EdgeInsets.fromLTRB(110.0, 1.0, 80.0, 2.0)), const SliverPadding(padding: const EdgeInsets.fromLTRB(110.0, 1.0, 80.0, 2.0)),
const SliverToBoxAdapter(child: const SizedBox(width: 201.0, child: const Text('x'))), const SliverToBoxAdapter(child: const SizedBox(width: 201.0, child: const Text('x'))),
], ],
...@@ -297,7 +297,7 @@ void main() { ...@@ -297,7 +297,7 @@ void main() {
child: new Viewport( child: new Viewport(
axisDirection: AxisDirection.up, axisDirection: AxisDirection.up,
offset: new ViewportOffset.fixed(0.0), offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
], ],
), ),
...@@ -310,7 +310,7 @@ void main() { ...@@ -310,7 +310,7 @@ void main() {
child: new Viewport( child: new Viewport(
axisDirection: AxisDirection.down, axisDirection: AxisDirection.down,
offset: new ViewportOffset.fixed(0.0), offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
], ],
), ),
...@@ -323,7 +323,7 @@ void main() { ...@@ -323,7 +323,7 @@ void main() {
child: new Viewport( child: new Viewport(
axisDirection: AxisDirection.right, axisDirection: AxisDirection.right,
offset: new ViewportOffset.fixed(0.0), offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
], ],
), ),
...@@ -336,7 +336,7 @@ void main() { ...@@ -336,7 +336,7 @@ void main() {
child: new Viewport( child: new Viewport(
axisDirection: AxisDirection.left, axisDirection: AxisDirection.left,
offset: new ViewportOffset.fixed(0.0), offset: new ViewportOffset.fixed(0.0),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
], ],
), ),
...@@ -349,7 +349,7 @@ void main() { ...@@ -349,7 +349,7 @@ void main() {
child: new Viewport( child: new Viewport(
axisDirection: AxisDirection.left, axisDirection: AxisDirection.left,
offset: new ViewportOffset.fixed(99999.9), offset: new ViewportOffset.fixed(99999.9),
slivers: <Widget>[ slivers: const <Widget>[
const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)),
], ],
), ),
......
...@@ -13,7 +13,7 @@ Future<Null> test(WidgetTester tester, double offset, { double anchor: 0.0 }) { ...@@ -13,7 +13,7 @@ Future<Null> test(WidgetTester tester, double offset, { double anchor: 0.0 }) {
child: new Viewport( child: new Viewport(
anchor: anchor / 600.0, anchor: anchor / 600.0,
offset: new ViewportOffset.fixed(offset), offset: new ViewportOffset.fixed(offset),
slivers: <Widget>[ slivers: const <Widget>[
const SliverToBoxAdapter(child: const SizedBox(height: 400.0)), const SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
const SliverToBoxAdapter(child: const SizedBox(height: 400.0)), const SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
const SliverToBoxAdapter(child: const SizedBox(height: 400.0)), const SliverToBoxAdapter(child: const SizedBox(height: 400.0)),
......
...@@ -636,7 +636,7 @@ void main() { ...@@ -636,7 +636,7 @@ void main() {
textDirection: TextDirection.rtl, textDirection: TextDirection.rtl,
child: new Stack( child: new Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: <Widget>[ children: const <Widget>[
const SizedBox(width: 100.0, height: 100.0), const SizedBox(width: 100.0, height: 100.0),
const Positioned(left: 0.0, child: const SizedBox(width: 100.0, height: 100.0)), const Positioned(left: 0.0, child: const SizedBox(width: 100.0, height: 100.0)),
const Positioned(right: 0.0, child: const SizedBox(width: 100.0, height: 100.0)), const Positioned(right: 0.0, child: const SizedBox(width: 100.0, height: 100.0)),
...@@ -665,7 +665,7 @@ void main() { ...@@ -665,7 +665,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Stack( child: new Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: <Widget>[ children: const <Widget>[
const SizedBox(width: 100.0, height: 100.0), const SizedBox(width: 100.0, height: 100.0),
const Positioned(left: 0.0, child: const SizedBox(width: 100.0, height: 100.0)), const Positioned(left: 0.0, child: const SizedBox(width: 100.0, height: 100.0)),
const Positioned(right: 0.0, child: const SizedBox(width: 100.0, height: 100.0)), const Positioned(right: 0.0, child: const SizedBox(width: 100.0, height: 100.0)),
...@@ -694,7 +694,7 @@ void main() { ...@@ -694,7 +694,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Stack( child: new Stack(
alignment: Alignment.bottomRight, alignment: Alignment.bottomRight,
children: <Widget>[ children: const <Widget>[
const SizedBox(width: 100.0, height: 100.0), const SizedBox(width: 100.0, height: 100.0),
const Positioned(left: 0.0, child: const SizedBox(width: 100.0, height: 100.0)), const Positioned(left: 0.0, child: const SizedBox(width: 100.0, height: 100.0)),
const Positioned(right: 0.0, child: const SizedBox(width: 100.0, height: 100.0)), const Positioned(right: 0.0, child: const SizedBox(width: 100.0, height: 100.0)),
...@@ -723,7 +723,7 @@ void main() { ...@@ -723,7 +723,7 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Stack( child: new Stack(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
children: <Widget>[ children: const <Widget>[
const SizedBox(width: 100.0, height: 100.0), const SizedBox(width: 100.0, height: 100.0),
const Positioned(left: 0.0, child: const SizedBox(width: 100.0, height: 100.0)), const Positioned(left: 0.0, child: const SizedBox(width: 100.0, height: 100.0)),
const Positioned(right: 0.0, child: const SizedBox(width: 100.0, height: 100.0)), const Positioned(right: 0.0, child: const SizedBox(width: 100.0, height: 100.0)),
......
...@@ -16,7 +16,7 @@ void main() { ...@@ -16,7 +16,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Stack( child: new Stack(
children: <Widget>[ children: const <Widget>[
const Text('a', textDirection: TextDirection.ltr), const Text('a', textDirection: TextDirection.ltr),
const Text('b', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr),
const Text('c', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr),
...@@ -31,7 +31,7 @@ void main() { ...@@ -31,7 +31,7 @@ void main() {
child: new WidgetInspector( child: new WidgetInspector(
selectButtonBuilder: null, selectButtonBuilder: null,
child: new Stack( child: new Stack(
children: <Widget>[ children: const <Widget>[
const Text('a', textDirection: TextDirection.ltr), const Text('a', textDirection: TextDirection.ltr),
const Text('b', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr),
const Text('c', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr),
...@@ -353,7 +353,7 @@ void main() { ...@@ -353,7 +353,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Stack( child: new Stack(
children: <Widget>[ children: const <Widget>[
const Text('a', textDirection: TextDirection.ltr), const Text('a', textDirection: TextDirection.ltr),
const Text('b', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr),
const Text('c', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr),
...@@ -403,7 +403,7 @@ void main() { ...@@ -403,7 +403,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Stack( child: new Stack(
children: <Widget>[ children: const <Widget>[
const Text('a', textDirection: TextDirection.ltr), const Text('a', textDirection: TextDirection.ltr),
const Text('b', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr),
const Text('c', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr),
...@@ -476,7 +476,7 @@ void main() { ...@@ -476,7 +476,7 @@ void main() {
new Directionality( new Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: new Stack( child: new Stack(
children: <Widget>[ children: const <Widget>[
const Text('a', textDirection: TextDirection.ltr), const Text('a', textDirection: TextDirection.ltr),
const Text('b', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr),
const Text('c', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr),
......
...@@ -134,7 +134,7 @@ void main() { ...@@ -134,7 +134,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Localizations( new Localizations(
locale: const Locale('en', 'US'), locale: const Locale('en', 'US'),
delegates: <LocalizationsDelegate<dynamic>>[ delegates: const <LocalizationsDelegate<dynamic>>[
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
DefaultWidgetsLocalizations.delegate, DefaultWidgetsLocalizations.delegate,
], ],
......
...@@ -606,7 +606,7 @@ void main() { ...@@ -606,7 +606,7 @@ void main() {
buildContent: (BuildContext context) { buildContent: (BuildContext context) {
return new Localizations.override( return new Localizations.override(
context: context, context: context,
delegates: <OnlyRTLDefaultWidgetsLocalizationsDelegate>[ delegates: const <OnlyRTLDefaultWidgetsLocalizationsDelegate>[
// Override: no matter what the locale, textDirection is always RTL. // Override: no matter what the locale, textDirection is always RTL.
const OnlyRTLDefaultWidgetsLocalizationsDelegate(), const OnlyRTLDefaultWidgetsLocalizationsDelegate(),
], ],
......
...@@ -177,7 +177,7 @@ void main() { ...@@ -177,7 +177,7 @@ void main() {
await tester.pumpWidget(new Row( await tester.pumpWidget(new Row(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: <Widget>[ children: <Widget>[
new Column(children: <Text>[const Text('foo', textDirection: TextDirection.ltr)]), new Column(children: const <Text>[const Text('foo', textDirection: TextDirection.ltr)]),
const Text('bar', textDirection: TextDirection.ltr), const Text('bar', textDirection: TextDirection.ltr),
], ],
)); ));
...@@ -237,7 +237,7 @@ void main() { ...@@ -237,7 +237,7 @@ void main() {
await tester.pumpWidget(new Row( await tester.pumpWidget(new Row(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: <Widget>[ children: <Widget>[
new Column(children: <Text>[const Text('foo', textDirection: TextDirection.ltr)]), new Column(children: const <Text>[const Text('foo', textDirection: TextDirection.ltr)]),
const Text('bar', textDirection: TextDirection.ltr), const Text('bar', textDirection: TextDirection.ltr),
], ],
)); ));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment