From 0fe1e5bf5b79cd3c2843f2731bac931ec5e10f5b Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Thu, 11 Jan 2018 08:38:55 +0100 Subject: [PATCH] apply upcoming lint prefer_const_literals_to_create_immutables (#14029) --- dev/benchmarks/complex_layout/lib/main.dart | 10 +- dev/integration_tests/ui/lib/driver.dart | 2 +- dev/manual_tests/lib/card_collection.dart | 4 +- .../lib/demo/contacts_demo.dart | 24 +- .../cupertino/cupertino_navigation_demo.dart | 14 +- .../material/selection_controls_demo.dart | 4 +- .../lib/demo/material/slider_demo.dart | 2 +- .../demo/material/two_level_list_demo.dart | 2 +- .../flutter_gallery/lib/demo/pesto_demo.dart | 12 +- examples/stocks/lib/stock_home.dart | 2 +- examples/stocks/lib/stock_symbol_viewer.dart | 2 +- .../test/cupertino/bottom_tab_bar_test.dart | 12 +- .../flutter/test/cupertino/page_test.dart | 4 +- .../flutter/test/cupertino/scaffold_test.dart | 6 +- .../test/cupertino/tab_scaffold_test.dart | 2 +- .../flutter/test/material/about_test.dart | 6 +- .../flutter/test/material/app_bar_test.dart | 16 +- .../material/bottom_navigation_bar_test.dart | 26 +-- packages/flutter/test/material/chip_test.dart | 6 +- .../flutter/test/material/dialog_test.dart | 4 +- .../test/material/expansion_tile_test.dart | 2 +- .../flutter/test/material/list_tile_test.dart | 2 +- .../material/mergeable_material_test.dart | 108 ++++----- .../test/material/page_selector_test.dart | 2 +- .../material/paginated_data_table_test.dart | 16 +- .../material/progress_indicator_test.dart | 4 +- .../test/material/refresh_indicator_test.dart | 24 +- .../flutter/test/material/scaffold_test.dart | 4 +- .../flutter/test/material/stepper_test.dart | 24 +- packages/flutter/test/material/tabs_test.dart | 16 +- .../flutter/test/material/theme_test.dart | 2 +- .../test/material/two_level_list_test.dart | 10 +- .../user_accounts_drawer_header_test.dart | 2 +- .../test/rendering/flex_overflow_test.dart | 6 +- .../flutter/test/widgets/app_title_test.dart | 2 +- .../widgets/automatic_keep_alive_test.dart | 20 +- .../widgets/box_sliver_mismatch_test.dart | 6 +- .../flutter/test/widgets/center_test.dart | 2 +- .../test/widgets/dismissible_test.dart | 2 +- .../flutter/test/widgets/draggable_test.dart | 2 +- packages/flutter/test/widgets/flex_test.dart | 4 +- packages/flutter/test/widgets/focus_test.dart | 6 +- .../test/widgets/image_headers_test.dart | 2 +- .../test/widgets/implicit_semantics_test.dart | 8 +- .../test/widgets/list_view_misc_test.dart | 4 +- .../test/widgets/list_view_relayout_test.dart | 28 +-- .../flutter/test/widgets/list_view_test.dart | 2 +- .../widgets/overscroll_indicator_test.dart | 28 +-- .../flutter/test/widgets/page_view_test.dart | 6 +- .../test/widgets/placeholder_test.dart | 6 +- .../test/widgets/scroll_view_test.dart | 8 +- .../flutter/test/widgets/scrollable_test.dart | 2 +- .../test/widgets/shader_mask_test.dart | 6 +- .../test/widgets/slivers_block_test.dart | 8 +- .../test/widgets/slivers_padding_test.dart | 16 +- .../flutter/test/widgets/slivers_test.dart | 2 +- packages/flutter/test/widgets/stack_test.dart | 8 +- packages/flutter/test/widgets/table_test.dart | 216 +++++++++--------- .../test/widgets/widget_inspector_test.dart | 10 +- packages/flutter/test/widgets/wrap_test.dart | 74 +++--- .../test/time_picker_test.dart | 2 +- .../test/widgets_test.dart | 2 +- .../flutter_test/test/widget_tester_test.dart | 4 +- 63 files changed, 436 insertions(+), 432 deletions(-) diff --git a/dev/benchmarks/complex_layout/lib/main.dart b/dev/benchmarks/complex_layout/lib/main.dart index 215a602db5..592593f649 100644 --- a/dev/benchmarks/complex_layout/lib/main.dart +++ b/dev/benchmarks/complex_layout/lib/main.dart @@ -267,7 +267,7 @@ class IconBar extends StatelessWidget { padding: const EdgeInsets.only(left: 16.0, right: 16.0), child: new Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: const [ const IconWithText(Icons.thumb_up, 'Like'), const IconWithText(Icons.comment, 'Comment'), const IconWithText(Icons.share, 'Share'), @@ -438,10 +438,10 @@ class ItemImageBox extends StatelessWidget { borderRadius: new BorderRadius.circular(2.0) ), padding: const EdgeInsets.all(4.0), - child: new RichText( - text: new TextSpan( + child: const RichText( + text: const TextSpan( style: const TextStyle(color: Colors.white), - children: [ + children: const [ const TextSpan( text: 'Photo by ' ), @@ -560,7 +560,7 @@ class BottomBar extends StatelessWidget { ), child: new Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: const [ const BottomBarButton(Icons.new_releases, 'News'), const BottomBarButton(Icons.people, 'Requests'), const BottomBarButton(Icons.chat, 'Messenger'), diff --git a/dev/integration_tests/ui/lib/driver.dart b/dev/integration_tests/ui/lib/driver.dart index cb39d45356..a2e1718516 100644 --- a/dev/integration_tests/ui/lib/driver.dart +++ b/dev/integration_tests/ui/lib/driver.dart @@ -66,7 +66,7 @@ class DriverTestAppState extends State { _selectedValue = newValue; }); }, - items: >[ + items: const >[ const DropdownMenuItem( value: Letter.a, child: const Text('Aaa', key: const ValueKey('a')), diff --git a/dev/manual_tests/lib/card_collection.dart b/dev/manual_tests/lib/card_collection.dart index a4e11b6a4b..7cb366270e 100644 --- a/dev/manual_tests/lib/card_collection.dart +++ b/dev/manual_tests/lib/card_collection.dart @@ -347,8 +347,8 @@ class CardCollectionState extends State { return new LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [const Color(0x00FFFFFF), const Color(0xFFFFFFFF)], - stops: [0.1, 0.35], + colors: const [const Color(0x00FFFFFF), const Color(0xFFFFFFFF)], + stops: const [0.1, 0.35], ) .createShader(bounds); } diff --git a/examples/flutter_gallery/lib/demo/contacts_demo.dart b/examples/flutter_gallery/lib/demo/contacts_demo.dart index 0a45d35327..c146f1fb88 100644 --- a/examples/flutter_gallery/lib/demo/contacts_demo.dart +++ b/examples/flutter_gallery/lib/demo/contacts_demo.dart @@ -193,7 +193,7 @@ class ContactsDemoState extends State { content: const Text('Pretend that this opened your SMS application.') )); }, - lines: [ + lines: const [ '(650) 555-1234', 'Mobile', ], @@ -206,7 +206,7 @@ class ContactsDemoState extends State { content: const Text('In this demo, this button doesn\'t do anything.') )); }, - lines: [ + lines: const [ '(323) 555-6789', 'Work', ], @@ -219,7 +219,7 @@ class ContactsDemoState extends State { content: const Text('Imagine if you will, a messaging application.') )); }, - lines: [ + lines: const [ '(650) 555-6789', 'Home', ], @@ -237,7 +237,7 @@ class ContactsDemoState extends State { content: const Text('Here, your e-mail application would open.') )); }, - lines: [ + lines: const [ 'ali_connors@example.com', 'Personal', ], @@ -250,7 +250,7 @@ class ContactsDemoState extends State { content: const Text('This is a demo, so this button does not actually work.') )); }, - lines: [ + lines: const [ 'aliconnors@example.com', 'Work', ], @@ -268,7 +268,7 @@ class ContactsDemoState extends State { content: const Text('This would show a map of San Francisco.') )); }, - lines: [ + lines: const [ '2000 Main Street', 'San Francisco, CA', 'Home', @@ -282,7 +282,7 @@ class ContactsDemoState extends State { content: const Text('This would show a map of Mountain View.') )); }, - lines: [ + lines: const [ '1600 Amphitheater Parkway', 'Mountain View, CA', 'Work', @@ -296,7 +296,7 @@ class ContactsDemoState extends State { content: const Text('This would also show a map, if this was not a demo.') )); }, - lines: [ + lines: const [ '126 Severyns Ave', 'Mountain View, CA', 'Jet Travel', @@ -308,25 +308,25 @@ class ContactsDemoState extends State { icon: Icons.today, children: [ new _ContactItem( - lines: [ + lines: const [ 'Birthday', 'January 9th, 1989', ], ), new _ContactItem( - lines: [ + lines: const [ 'Wedding anniversary', 'June 21st, 2014', ], ), new _ContactItem( - lines: [ + lines: const [ 'First day in office', 'January 20th, 2015', ], ), new _ContactItem( - lines: [ + lines: const [ 'Last day in office', 'August 9th, 2015', ], diff --git a/examples/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart b/examples/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart index 29e793f066..327f1db51f 100644 --- a/examples/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart +++ b/examples/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart @@ -441,7 +441,7 @@ class Tab2Header extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 18.0, vertical: 12.0), child: new Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: const [ const Text( 'SUPPORT TICKET', style: const TextStyle( @@ -725,10 +725,14 @@ class CupertinoDemoTab3 extends StatelessWidget { child: new SafeArea( top: false, bottom: false, - child: new Row(children: [ const Text( - 'Sign in', - style: const TextStyle(color: CupertinoColors.activeBlue), - ) ]), + child: new Row( + children: const [ + const Text( + 'Sign in', + style: const TextStyle(color: CupertinoColors.activeBlue), + ) + ], + ), ), ), ), diff --git a/examples/flutter_gallery/lib/demo/material/selection_controls_demo.dart b/examples/flutter_gallery/lib/demo/material/selection_controls_demo.dart index a06a089bb5..1f9ca58b8c 100644 --- a/examples/flutter_gallery/lib/demo/material/selection_controls_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/selection_controls_demo.dart @@ -96,7 +96,7 @@ class _SelectionControlsDemoState extends State { ), new Row( mainAxisSize: MainAxisSize.min, - children: [ + children: const [ // Disabled checkboxes const Checkbox(value: true, onChanged: null), const Checkbox(value: false, onChanged: null) @@ -136,7 +136,7 @@ class _SelectionControlsDemoState extends State { // Disabled radio buttons new Row( mainAxisSize: MainAxisSize.min, - children: [ + children: const [ const Radio( value: 0, groupValue: 0, diff --git a/examples/flutter_gallery/lib/demo/material/slider_demo.dart b/examples/flutter_gallery/lib/demo/material/slider_demo.dart index 4bc9c29d01..fbd22124c1 100644 --- a/examples/flutter_gallery/lib/demo/material/slider_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/slider_demo.dart @@ -43,7 +43,7 @@ class _SliderDemoState extends State { ), new Column( mainAxisSize: MainAxisSize.min, - children: [ + children: const [ const Slider(value: 0.25, thumbOpenAtMin: true, onChanged: null), const Text('Disabled'), ] diff --git a/examples/flutter_gallery/lib/demo/material/two_level_list_demo.dart b/examples/flutter_gallery/lib/demo/material/two_level_list_demo.dart index 34fbdaac68..a2a1ad48fc 100644 --- a/examples/flutter_gallery/lib/demo/material/two_level_list_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/two_level_list_demo.dart @@ -17,7 +17,7 @@ class TwoLevelListDemo extends StatelessWidget { new ExpansionTile( title: const Text('Sublist'), backgroundColor: Theme.of(context).accentColor.withOpacity(0.025), - children: [ + children: const [ const ListTile(title: const Text('One')), const ListTile(title: const Text('Two')), // https://en.wikipedia.org/wiki/Free_Four diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart index 1cad222af5..1175f06ada 100644 --- a/examples/flutter_gallery/lib/demo/pesto_demo.dart +++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart @@ -362,13 +362,13 @@ class _RecipePageState extends State { ], ), ], - flexibleSpace: new FlexibleSpaceBar( - background: new DecoratedBox( - decoration: new BoxDecoration( - gradient: new LinearGradient( + flexibleSpace: const FlexibleSpaceBar( + background: const DecoratedBox( + decoration: const BoxDecoration( + gradient: const LinearGradient( begin: const Alignment(0.0, -1.0), end: const Alignment(0.0, -0.2), - colors: [const Color(0x60000000), const Color(0x00000000)], + colors: const[const Color(0x60000000), const Color(0x00000000)], ), ), ), @@ -444,7 +444,7 @@ class RecipeSheet extends StatelessWidget { child: new Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 40.0), child: new Table( - columnWidths: { + columnWidths: const { 0: const FixedColumnWidth(64.0) }, children: [ diff --git a/examples/stocks/lib/stock_home.dart b/examples/stocks/lib/stock_home.dart index d12730fd07..297dd38856 100644 --- a/examples/stocks/lib/stock_home.dart +++ b/examples/stocks/lib/stock_home.dart @@ -336,7 +336,7 @@ class _CreateCompanySheet extends StatelessWidget { @override Widget build(BuildContext context) { return new Column( - children: [ + children: const [ const TextField( autofocus: true, decoration: const InputDecoration( diff --git a/examples/stocks/lib/stock_symbol_viewer.dart b/examples/stocks/lib/stock_symbol_viewer.dart index 6fc0778934..319f7bb716 100644 --- a/examples/stocks/lib/stock_symbol_viewer.dart +++ b/examples/stocks/lib/stock_symbol_viewer.dart @@ -50,7 +50,7 @@ class _StockSymbolView extends StatelessWidget { text: new TextSpan( style: DefaultTextStyle.of(context).style.merge(const TextStyle(fontSize: 8.0)), text: 'Prices may be delayed by ', - children: [ + children: const [ const TextSpan(text: 'several', style: const TextStyle(fontStyle: FontStyle.italic)), const TextSpan(text: ' years.'), ] diff --git a/packages/flutter/test/cupertino/bottom_tab_bar_test.dart b/packages/flutter/test/cupertino/bottom_tab_bar_test.dart index effa4df395..e951cdf0c6 100644 --- a/packages/flutter/test/cupertino/bottom_tab_bar_test.dart +++ b/packages/flutter/test/cupertino/bottom_tab_bar_test.dart @@ -20,7 +20,7 @@ void main() { testWidgets('Need at least 2 tabs', (WidgetTester tester) async { try { await pumpWidgetWithBoilerplate(tester, new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), @@ -38,7 +38,7 @@ void main() { await pumpWidgetWithBoilerplate(tester, new MediaQuery( data: const MediaQueryData(), child: new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), @@ -69,7 +69,7 @@ void main() { testWidgets('Adjusts height to account for bottom padding', (WidgetTester tester) async { final CupertinoTabBar tabBar = new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Aka'), @@ -110,7 +110,7 @@ void main() { await pumpWidgetWithBoilerplate(tester, new MediaQuery( data: const MediaQueryData(), child: new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), @@ -128,7 +128,7 @@ void main() { await pumpWidgetWithBoilerplate(tester, new MediaQuery( data: const MediaQueryData(), child: new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), @@ -151,7 +151,7 @@ void main() { await pumpWidgetWithBoilerplate(tester, new MediaQuery( data: const MediaQueryData(), child: new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), diff --git a/packages/flutter/test/cupertino/page_test.dart b/packages/flutter/test/cupertino/page_test.dart index 686483cb3b..fdb562a4c1 100644 --- a/packages/flutter/test/cupertino/page_test.dart +++ b/packages/flutter/test/cupertino/page_test.dart @@ -77,7 +77,7 @@ void main() { testWidgets('test iOS page transition (RTL)', (WidgetTester tester) async { await tester.pumpWidget( new WidgetsApp( - localizationsDelegates: >[ + localizationsDelegates: const >[ const RtlOverrideWidgetsDelegate(), ], color: const Color(0xFFFFFFFF), @@ -279,7 +279,7 @@ void main() { testWidgets('test only edge swipes work (RTL)', (WidgetTester tester) async { await tester.pumpWidget( new WidgetsApp( - localizationsDelegates: >[ + localizationsDelegates: const >[ const RtlOverrideWidgetsDelegate(), ], color: const Color(0xFFFFFFFF), diff --git a/packages/flutter/test/cupertino/scaffold_test.dart b/packages/flutter/test/cupertino/scaffold_test.dart index ecf18b3ff8..602f9ad72b 100644 --- a/packages/flutter/test/cupertino/scaffold_test.dart +++ b/packages/flutter/test/cupertino/scaffold_test.dart @@ -46,7 +46,7 @@ void main() { return new CupertinoTabScaffold( tabBar: new CupertinoTabBar( backgroundColor: CupertinoColors.white, - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), @@ -94,7 +94,7 @@ void main() { ), child: new CupertinoTabScaffold( tabBar: new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), @@ -150,7 +150,7 @@ void main() { builder: (BuildContext context) { return new CupertinoTabScaffold( tabBar: new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), diff --git a/packages/flutter/test/cupertino/tab_scaffold_test.dart b/packages/flutter/test/cupertino/tab_scaffold_test.dart index e17cd7f41a..3c469c63c5 100644 --- a/packages/flutter/test/cupertino/tab_scaffold_test.dart +++ b/packages/flutter/test/cupertino/tab_scaffold_test.dart @@ -123,7 +123,7 @@ void main() { CupertinoTabBar _buildTabBar() { return new CupertinoTabBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const ImageIcon(const TestImageProvider(24, 24)), title: const Text('Tab 1'), diff --git a/packages/flutter/test/material/about_test.dart b/packages/flutter/test/material/about_test.dart index 2087e9398b..d922198df8 100644 --- a/packages/flutter/test/material/about_test.dart +++ b/packages/flutter/test/material/about_test.dart @@ -19,12 +19,12 @@ void main() { ), drawer: new Drawer( child: new ListView( - children: [ - new AboutListTile( + children: const [ + const AboutListTile( applicationVersion: '0.1.2', applicationIcon: const FlutterLogo(), applicationLegalese: 'I am the very model of a modern major general.', - aboutBoxChildren: [ + aboutBoxChildren: const [ const Text('About box'), ] ), diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart index e4b0875260..c25777c5ae 100644 --- a/packages/flutter/test/material/app_bar_test.dart +++ b/packages/flutter/test/material/app_bar_test.dart @@ -109,7 +109,7 @@ void main() { home: new Scaffold( appBar: new AppBar( title: const Text('X'), - actions: [ + actions: const [ const Icon(Icons.thumb_up), ], ), @@ -130,7 +130,7 @@ void main() { home: new Scaffold( appBar: new AppBar( title: const Text('X'), - actions: [ + actions: const [ const Icon(Icons.thumb_up), const Icon(Icons.thumb_up), ], @@ -458,7 +458,7 @@ void main() { child: new AppBar( leading: const Text('L'), title: const Text('No Scaffold'), - actions: [const Text('A1'), const Text('A2')], + actions: const [const Text('A1'), const Text('A2')], ), ), ), @@ -548,7 +548,7 @@ void main() { home: new Scaffold( appBar: new AppBar( title: const Text('X'), - actions: [ + actions: const [ const IconButton( icon: const Icon(Icons.share), onPressed: null, @@ -977,7 +977,7 @@ void main() { child: new AppBar( leading: new Placeholder(key: key), title: const Text('Abc'), - actions: [ + actions: const [ const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0), @@ -998,7 +998,7 @@ void main() { child: new AppBar( leading: new Placeholder(key: key), title: const Text('Abc'), - actions: [ + actions: const [ const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0), @@ -1028,7 +1028,7 @@ void main() { child: new AppBar( leading: new Placeholder(key: key), title: const Text('Abc'), - actions: [ + actions: const [ const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0), @@ -1069,7 +1069,7 @@ void main() { child: new AppBar( leading: new Placeholder(key: key), title: const Text('Abc'), - actions: [ + actions: const [ const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0), const Placeholder(fallbackWidth: 10.0), diff --git a/packages/flutter/test/material/bottom_navigation_bar_test.dart b/packages/flutter/test/material/bottom_navigation_bar_test.dart index 7dfed2b52c..39869712ff 100644 --- a/packages/flutter/test/material/bottom_navigation_bar_test.dart +++ b/packages/flutter/test/material/bottom_navigation_bar_test.dart @@ -16,7 +16,7 @@ void main() { new MaterialApp( home: new Scaffold( bottomNavigationBar: new BottomNavigationBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const Icon(Icons.ac_unit), title: const Text('AC') @@ -44,7 +44,7 @@ void main() { new MaterialApp( home: new Scaffold( bottomNavigationBar: new BottomNavigationBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const Icon(Icons.ac_unit), title: const Text('AC') @@ -72,7 +72,7 @@ void main() { data: const MediaQueryData(padding: const EdgeInsets.only(bottom: 40.0)), child: new Scaffold( bottomNavigationBar: new BottomNavigationBar( - items: [ + items: const [ const BottomNavigationBarItem( icon: const Icon(Icons.ac_unit), title: const Text('AC') @@ -100,7 +100,7 @@ void main() { home: new Scaffold( bottomNavigationBar: new BottomNavigationBar( type: BottomNavigationBarType.shifting, - items: [ + items: const [ const BottomNavigationBarItem( icon: const Icon(Icons.ac_unit), title: const Text('AC') @@ -126,7 +126,7 @@ void main() { bottomNavigationBar: new BottomNavigationBar( currentIndex: 1, type: BottomNavigationBarType.shifting, - items: [ + items: const [ const BottomNavigationBarItem( icon: const Icon(Icons.ac_unit), title: const Text('AC') @@ -155,7 +155,7 @@ void main() { home: new Scaffold( bottomNavigationBar: new BottomNavigationBar( type: BottomNavigationBarType.shifting, - items: [ + items: const [ const BottomNavigationBarItem( icon: const Icon(Icons.ac_unit), title: const Text('AC') @@ -216,7 +216,7 @@ void main() { child: new Scaffold( bottomNavigationBar: new BottomNavigationBar( type: BottomNavigationBarType.shifting, - items: [ + items: const [ const BottomNavigationBarItem( icon: const Icon(Icons.ac_unit), title: const Text('AC') @@ -254,7 +254,7 @@ void main() { child: new Scaffold( bottomNavigationBar: new BottomNavigationBar( type: BottomNavigationBarType.fixed, - items: [ + items: const [ const BottomNavigationBarItem( icon: const Icon(Icons.ac_unit), title: const Text('AC') @@ -326,7 +326,7 @@ void main() { home: new Scaffold( bottomNavigationBar: new BottomNavigationBar( type: BottomNavigationBarType.fixed, - items: [ + items: const [ const BottomNavigationBarItem( title: const Text('A'), icon: const Icon(Icons.ac_unit), @@ -349,7 +349,7 @@ void main() { home: new Scaffold( bottomNavigationBar: new BottomNavigationBar( type: BottomNavigationBarType.shifting, - items: [ + items: const [ const BottomNavigationBarItem( title: const Text('A'), icon: const Icon(Icons.ac_unit), @@ -373,7 +373,7 @@ void main() { data: const MediaQueryData(textScaleFactor: 2.0), child: new Scaffold( bottomNavigationBar: new BottomNavigationBar( - items: [ + items: const [ const BottomNavigationBarItem( title: const Text('A'), icon: const Icon(Icons.ac_unit), @@ -430,7 +430,7 @@ void main() { boilerplate( textDirection: TextDirection.ltr, bottomNavigationBar: new BottomNavigationBar( - items: [ + items: const [ const BottomNavigationBarItem( title: const Text('A'), icon: const Icon(Icons.ac_unit), @@ -462,7 +462,7 @@ void main() { boilerplate( textDirection: TextDirection.rtl, bottomNavigationBar: new BottomNavigationBar( - items: [ + items: const [ const BottomNavigationBarItem( title: const Text('A'), icon: const Icon(Icons.ac_unit), diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart index 31e80f0c16..c05eb8a07b 100644 --- a/packages/flutter/test/material/chip_test.dart +++ b/packages/flutter/test/material/chip_test.dart @@ -274,7 +274,7 @@ void main() { new MaterialApp( home: new Material( child: new Column( - children: [ + children: const [ const Chip( avatar: const CircleAvatar( child: const Text('A') @@ -318,7 +318,7 @@ void main() { data: const MediaQueryData(textScaleFactor: 3.0), child: new Material( child: new Column( - children: [ + children: const [ const Chip( avatar: const CircleAvatar( child: const Text('A') @@ -352,7 +352,7 @@ void main() { new MaterialApp( home: new Material( child: new Column( - children: [ + children: const [ const Chip( avatar: const CircleAvatar( child: const Text('A') diff --git a/packages/flutter/test/material/dialog_test.dart b/packages/flutter/test/material/dialog_test.dart index 09aec20f57..6883981aeb 100644 --- a/packages/flutter/test/material/dialog_test.dart +++ b/packages/flutter/test/material/dialog_test.dart @@ -71,10 +71,10 @@ void main() { onPressed: () { showDialog( context: context, - child: new AlertDialog( + child: const AlertDialog( title: const Text('Title'), content: const Text('Y'), - actions: [ ], + actions: const [ ], ), ); }, diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index 799fe53292..77d4c6d9f3 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -53,7 +53,7 @@ void main() { new ExpansionTile( key: defaultKey, title: const Text('Default'), - children: [ + children: const [ const ListTile(title: const Text('0')), ] ) diff --git a/packages/flutter/test/material/list_tile_test.dart b/packages/flutter/test/material/list_tile_test.dart index f56b0a0890..789d04f853 100644 --- a/packages/flutter/test/material/list_tile_test.dart +++ b/packages/flutter/test/material/list_tile_test.dart @@ -337,7 +337,7 @@ void main() { child: new MediaQuery( data: const MediaQueryData(), child: new Column( - children: [ + children: const [ const ListTile( title: const Text('one'), ), diff --git a/packages/flutter/test/material/mergeable_material_test.dart b/packages/flutter/test/material/mergeable_material_test.dart index 93d25b6338..1ceb9cd8b5 100644 --- a/packages/flutter/test/material/mergeable_material_test.dart +++ b/packages/flutter/test/material/mergeable_material_test.dart @@ -85,8 +85,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -108,8 +108,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -133,8 +133,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -165,8 +165,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('B'), child: const SizedBox( @@ -202,8 +202,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -233,8 +233,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -269,8 +269,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -310,8 +310,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -342,8 +342,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -386,8 +386,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -418,8 +418,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -460,8 +460,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -499,8 +499,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -543,8 +543,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -575,8 +575,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -615,8 +615,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -654,8 +654,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -688,8 +688,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -720,8 +720,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -776,8 +776,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -823,8 +823,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -864,8 +864,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -900,8 +900,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -956,8 +956,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -1003,8 +1003,8 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( - children: [ + child: const MergeableMaterial( + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -1059,9 +1059,9 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( + child: const MergeableMaterial( hasDividers: true, - children: [ + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( @@ -1109,9 +1109,9 @@ void main() { new MaterialApp( home: new Scaffold( body: new SingleChildScrollView( - child: new MergeableMaterial( + child: const MergeableMaterial( hasDividers: true, - children: [ + children: const [ const MaterialSlice( key: const ValueKey('A'), child: const SizedBox( diff --git a/packages/flutter/test/material/page_selector_test.dart b/packages/flutter/test/material/page_selector_test.dart index 8abe971740..ad351df599 100644 --- a/packages/flutter/test/material/page_selector_test.dart +++ b/packages/flutter/test/material/page_selector_test.dart @@ -29,7 +29,7 @@ Widget buildFrame(TabController tabController, { Color color, Color selectedColo new Flexible( child: new TabBarView( controller: tabController, - children: [ + children: const [ const Center(child: const Text('0')), const Center(child: const Text('1')), const Center(child: const Text('2')), diff --git a/packages/flutter/test/material/paginated_data_table_test.dart b/packages/flutter/test/material/paginated_data_table_test.dart index 19c9e21119..a6d53eb273 100644 --- a/packages/flutter/test/material/paginated_data_table_test.dart +++ b/packages/flutter/test/material/paginated_data_table_test.dart @@ -52,7 +52,7 @@ void main() { header: const Text('Test table'), source: source, rowsPerPage: 2, - availableRowsPerPage: [ + availableRowsPerPage: const [ 2, 4, 8, 16, ], onRowsPerPageChanged: (int rowsPerPage) { @@ -61,7 +61,7 @@ void main() { onPageChanged: (int rowIndex) { log.add('page-changed: $rowIndex'); }, - columns: [ + columns: const [ const DataColumn(label: const Text('Name')), const DataColumn(label: const Text('Calories'), numeric: true), const DataColumn(label: const Text('Generation')), @@ -199,11 +199,11 @@ void main() { header: const Text('HEADER'), source: new TestDataSource(), rowsPerPage: 8, - availableRowsPerPage: [ + availableRowsPerPage: const [ 8, 9, ], onRowsPerPageChanged: (int rowsPerPage) { }, - columns: [ + columns: const [ const DataColumn(label: const Text('COL1')), const DataColumn(label: const Text('COL2')), const DataColumn(label: const Text('COL3')), @@ -226,9 +226,9 @@ void main() { header: const Text('HEADER'), source: source, rowsPerPage: 501, - availableRowsPerPage: [ 501 ], + availableRowsPerPage: const [ 501 ], onRowsPerPageChanged: (int rowsPerPage) { }, - columns: [ + columns: const [ const DataColumn(label: const Text('COL1')), const DataColumn(label: const Text('COL2')), const DataColumn(label: const Text('COL3')), @@ -257,9 +257,9 @@ void main() { header: const Text('HEADER'), source: source, rowsPerPage: 5, - availableRowsPerPage: [ 5 ], + availableRowsPerPage: const [ 5 ], onRowsPerPageChanged: (int rowsPerPage) { }, - columns: [ + columns: const [ const DataColumn(label: const Text('COL1')), const DataColumn(label: const Text('COL2')), const DataColumn(label: const Text('COL3')), diff --git a/packages/flutter/test/material/progress_indicator_test.dart b/packages/flutter/test/material/progress_indicator_test.dart index 74c407bac6..e126ae5f7d 100644 --- a/packages/flutter/test/material/progress_indicator_test.dart +++ b/packages/flutter/test/material/progress_indicator_test.dart @@ -187,12 +187,12 @@ void main() { testWidgets('LinearProgressIndicator causes a repaint when it changes', (WidgetTester tester) async { await tester.pumpWidget(new Directionality( textDirection: TextDirection.ltr, - child: new ListView(children: [const LinearProgressIndicator(value: 0.0)]), + child: new ListView(children: const [const LinearProgressIndicator(value: 0.0)]), )); final List layers1 = tester.layers; await tester.pumpWidget(new Directionality( textDirection: TextDirection.ltr, - child: new ListView(children: [const LinearProgressIndicator(value: 0.5)])), + child: new ListView(children: const [const LinearProgressIndicator(value: 0.5)])), ); final List layers2 = tester.layers; expect(layers1, isNot(equals(layers2))); diff --git a/packages/flutter/test/material/refresh_indicator_test.dart b/packages/flutter/test/material/refresh_indicator_test.dart index 3f216ede15..8b45a35ec3 100644 --- a/packages/flutter/test/material/refresh_indicator_test.dart +++ b/packages/flutter/test/material/refresh_indicator_test.dart @@ -72,21 +72,21 @@ void main() { ), ), ); - + await tester.fling(find.text('A'), const Offset(300.0, 0.0), 1000.0); // horizontal fling await tester.pump(); 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 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.pump(); 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 hide animation - expect(refreshCalled, true); + expect(refreshCalled, true); }); testWidgets('RefreshIndicator - bottom', (WidgetTester tester) async { @@ -98,7 +98,7 @@ void main() { child: new ListView( reverse: true, physics: const AlwaysScrollableScrollPhysics(), - children: [ + children: const [ const SizedBox( height: 200.0, child: const Text('X'), @@ -125,7 +125,7 @@ void main() { onRefresh: holdRefresh, child: new ListView( physics: const AlwaysScrollableScrollPhysics(), - children: [ + children: const [ const SizedBox( height: 200.0, child: const Text('X'), @@ -152,7 +152,7 @@ void main() { child: new ListView( reverse: true, physics: const AlwaysScrollableScrollPhysics(), - children: [ + children: const [ const SizedBox( height: 200.0, child: const Text('X'), @@ -178,7 +178,7 @@ void main() { onRefresh: refresh, child: new ListView( physics: const AlwaysScrollableScrollPhysics(), - children: [ + children: const [ const SizedBox( height: 200.0, child: const Text('X'), @@ -206,7 +206,7 @@ void main() { onRefresh: refresh, child: new ListView( physics: const AlwaysScrollableScrollPhysics(), - children: [ + children: const [ const SizedBox( height: 200.0, child: const Text('X'), @@ -233,7 +233,7 @@ void main() { onRefresh: holdRefresh, // this one never returns child: new ListView( physics: const AlwaysScrollableScrollPhysics(), - children: [ + children: const [ const SizedBox( height: 200.0, child: const Text('X'), @@ -276,7 +276,7 @@ void main() { onRefresh: refresh, child: new ListView( physics: const AlwaysScrollableScrollPhysics(), - children: [ + children: const [ const SizedBox( height: 200.0, child: const Text('X'), @@ -320,7 +320,7 @@ void main() { onRefresh: refresh, child: new ListView( physics: const AlwaysScrollableScrollPhysics(), - children: [ + children: const [ const SizedBox( height: 200.0, child: const Text('X'), diff --git a/packages/flutter/test/material/scaffold_test.dart b/packages/flutter/test/material/scaffold_test.dart index 891410bc62..42aed59463 100644 --- a/packages/flutter/test/material/scaffold_test.dart +++ b/packages/flutter/test/material/scaffold_test.dart @@ -500,9 +500,9 @@ void main() { const String drawerLabel = 'I am the reason for this test'; 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), - persistentFooterButtons: [const Text(persistentFooterButtonLabel)], + persistentFooterButtons: const [const Text(persistentFooterButtonLabel)], bottomNavigationBar: const Text(bottomNavigationBarLabel), floatingActionButton: const Text(floatingActionButtonLabel), drawer: const Drawer(child:const Text(drawerLabel)), diff --git a/packages/flutter/test/material/stepper_test.dart b/packages/flutter/test/material/stepper_test.dart index 88cb72a04a..7129fd2aea 100644 --- a/packages/flutter/test/material/stepper_test.dart +++ b/packages/flutter/test/material/stepper_test.dart @@ -16,7 +16,7 @@ void main() { onStepTapped: (int i) { index = i; }, - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const SizedBox( @@ -46,7 +46,7 @@ void main() { home: new Center( child: new Material( child: new Stepper( - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const SizedBox( @@ -77,7 +77,7 @@ void main() { child: new Material( child: new Stepper( currentStep: 1, - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const SizedBox( @@ -114,7 +114,7 @@ void main() { child: new Material( child: new Stepper( type: StepperType.horizontal, - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const SizedBox( @@ -139,7 +139,7 @@ void main() { home: new Material( child: new Stepper( type: StepperType.horizontal, - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const Text('A'), @@ -163,7 +163,7 @@ void main() { child: new Stepper( currentStep: 1, type: StepperType.horizontal, - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const Text('A'), @@ -197,7 +197,7 @@ void main() { onStepCancel: () { cancelPressed = true; }, - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const SizedBox( @@ -235,7 +235,7 @@ void main() { onStepTapped: (int i) { index = i; }, - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const SizedBox( @@ -266,7 +266,7 @@ void main() { new MaterialApp( home: new Material( child: new Stepper( - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const SizedBox( @@ -303,7 +303,7 @@ void main() { home: new Material( child: new Stepper( currentStep: 2, - steps: [ + steps: const [ const Step( title: const Text('Step 1'), content: const SizedBox( @@ -341,7 +341,7 @@ void main() { home: new Center( child: new Material( child: new Stepper( - steps: [ + steps: const [ const Step( title: const Text('A'), state: StepState.complete, @@ -374,7 +374,7 @@ void main() { home: new Center( child: new Material( child: new Stepper( - steps: [ + steps: const [ const Step( title: const Text('A'), state: StepState.error, diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 4ce35d2bd8..ed7cc6bc68 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -122,8 +122,8 @@ Widget buildLeftRightApp({ List tabs, String value }) { tabs: tabs.map((String tab) => new Tab(text: tab)).toList(), ), ), - body: new TabBarView( - children: [ + body: const TabBarView( + children: const [ const Center(child: const Text('LEFT CHILD')), const Center(child: const Text('RIGHT CHILD')) ] @@ -538,7 +538,7 @@ void main() { ), body: new TabBarView( controller: controller, - children: [ + children: const [ const Center(child: const Text('LEFT CHILD')), const Center(child: const Text('RIGHT CHILD')) ] @@ -597,7 +597,7 @@ void main() { ), body: new TabBarView( controller: controller, - children: [ + children: const [ const Center(child: const Text('CHILD A')), const Center(child: const Text('CHILD B')), const Center(child: const Text('CHILD C')), @@ -690,7 +690,7 @@ void main() { boilerplate( child: new TabBarView( controller: controller, - children: [ const Text('First'), const Text('Second') ], + children: const [ const Text('First'), const Text('Second') ], ), ), ); @@ -789,7 +789,7 @@ void main() { child: new TabBar( key: new UniqueKey(), controller: controller, - tabs: [ const Text('A'), const Text('B') ], + tabs: const [ const Text('A'), const Text('B') ], ), ); } @@ -822,7 +822,7 @@ void main() { height: 400.0, child: new TabBarView( controller: tabController, - children: [ + children: const [ const Center(child: const Text('0')), const Center(child: const Text('1')), const Center(child: const Text('2')), @@ -870,7 +870,7 @@ void main() { child: new TabBarView( controller: tabController, physics: const TestScrollPhysics(), - children: [ + children: const [ const Center(child: const Text('0')), const Center(child: const Text('1')), const Center(child: const Text('2')), diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index fbfa0af0c7..da20ff6a00 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -128,7 +128,7 @@ void main() { key: dropdownMenuButtonKey, onChanged: (String newValue) { }, value: 'menuItem', - items: >[ + items: const >[ const DropdownMenuItem( value: 'menuItem', child: const Text('menuItem'), diff --git a/packages/flutter/test/material/two_level_list_test.dart b/packages/flutter/test/material/two_level_list_test.dart index 1e1bada25d..f2f126509b 100644 --- a/packages/flutter/test/material/two_level_list_test.dart +++ b/packages/flutter/test/material/two_level_list_test.dart @@ -22,7 +22,7 @@ void main() { new ExpansionTile( key: sublistKey, title: const Text('Sublist'), - children: [ + children: const [ const ListTile(title: const Text('0')), const ListTile(title: const Text('1')) ] @@ -81,7 +81,7 @@ void main() { onExpansionChanged: (bool opened) { didChangeOpen = opened; }, - children: [ + children: const [ const ListTile(title: const Text('0')), const ListTile(title: const Text('1')) ] @@ -110,11 +110,11 @@ void main() { return new Material( child: new SingleChildScrollView( child: new Column( - children: [ + children: const [ const ListTile(title: const Text('Top')), - new ExpansionTile( + const ExpansionTile( title: const Text('Sublist'), - children: [ + children: const [ const ListTile(title: const Text('0')), const ListTile(title: const Text('1')) ], diff --git a/packages/flutter/test/material/user_accounts_drawer_header_test.dart b/packages/flutter/test/material/user_accounts_drawer_header_test.dart index 999e4d27a1..0a29e42761 100644 --- a/packages/flutter/test/material/user_accounts_drawer_header_test.dart +++ b/packages/flutter/test/material/user_accounts_drawer_header_test.dart @@ -40,7 +40,7 @@ Future pumpTestWidget(WidgetTester tester, { child: const Text('A'), ), ), - otherAccountsPictures: [ + otherAccountsPictures: const [ const CircleAvatar( child: const Text('B'), ), diff --git a/packages/flutter/test/rendering/flex_overflow_test.dart b/packages/flutter/test/rendering/flex_overflow_test.dart index e892b80339..ae8e800b9a 100644 --- a/packages/flutter/test/rendering/flex_overflow_test.dart +++ b/packages/flutter/test/rendering/flex_overflow_test.dart @@ -12,7 +12,7 @@ void main() { await tester.pumpWidget( new Center( child: new Column( - children: [ + children: const [ const SizedBox(width: 200.0, height: 200.0), ], ), @@ -26,7 +26,7 @@ void main() { child: new SizedBox( height: 100.0, child: new Column( - children: [ + children: const [ const SizedBox(width: 200.0, height: 200.0), ], ), @@ -43,7 +43,7 @@ void main() { child: new SizedBox( height: 0.0, child: new Column( - children: [ + children: const [ const SizedBox(width: 200.0, height: 200.0), ], ), diff --git a/packages/flutter/test/widgets/app_title_test.dart b/packages/flutter/test/widgets/app_title_test.dart index d8278dea83..dfd5b1d222 100644 --- a/packages/flutter/test/widgets/app_title_test.dart +++ b/packages/flutter/test/widgets/app_title_test.dart @@ -11,7 +11,7 @@ const String kTitleString = 'Hello World'; Future pumpApp(WidgetTester tester, { GenerateAppTitle onGenerateTitle }) async { await tester.pumpWidget( new WidgetsApp( - supportedLocales: [ + supportedLocales: const [ const Locale('en', 'US'), const Locale('en', 'GB'), ], diff --git a/packages/flutter/test/widgets/automatic_keep_alive_test.dart b/packages/flutter/test/widgets/automatic_keep_alive_test.dart index 17b9626a27..2bd554463b 100644 --- a/packages/flutter/test/widgets/automatic_keep_alive_test.dart +++ b/packages/flutter/test/widgets/automatic_keep_alive_test.dart @@ -221,7 +221,7 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ const Leaf(key: const GlobalObjectKey<_LeafState>(0), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()), ]), @@ -297,7 +297,7 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ const Leaf(key: const GlobalObjectKey<_LeafState>(0), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()), ]), @@ -306,7 +306,7 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(3), child: const Placeholder()), ]), @@ -315,7 +315,7 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ const Leaf(key: const GlobalObjectKey<_LeafState>(4), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(5), child: const Placeholder()), ]), @@ -349,7 +349,7 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()), ]), ), @@ -357,7 +357,7 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(3), child: const Placeholder()), ]), @@ -366,7 +366,7 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ 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>(0), child: const Placeholder()), @@ -408,7 +408,7 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ const Leaf(key: const GlobalObjectKey<_LeafState>(1), child: const Placeholder()), const Leaf(key: const GlobalObjectKey<_LeafState>(2), child: const Placeholder()), ]), @@ -417,14 +417,14 @@ void main() { new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ ]), ), ), new AutomaticKeepAlive( child: new Container( height: 400.0, - child: new Stack(children: [ + child: new Stack(children: const [ 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>(5), child: const Placeholder()), diff --git a/packages/flutter/test/widgets/box_sliver_mismatch_test.dart b/packages/flutter/test/widgets/box_sliver_mismatch_test.dart index 9827871996..a90f3d7899 100644 --- a/packages/flutter/test/widgets/box_sliver_mismatch_test.dart +++ b/packages/flutter/test/widgets/box_sliver_mismatch_test.dart @@ -21,7 +21,7 @@ void main() { await tester.pumpWidget( new Row( - children: [ + children: const [ const SliverList( delegate: const SliverChildListDelegate(const []), ), @@ -37,7 +37,7 @@ void main() { new Viewport( crossAxisDirection: AxisDirection.right, offset: new ViewportOffset.zero(), - slivers: [ + slivers: const [ const SizedBox(), ], ), @@ -49,7 +49,7 @@ void main() { new Viewport( crossAxisDirection: AxisDirection.right, offset: new ViewportOffset.zero(), - slivers: [ + slivers: const [ const SliverPadding( padding: EdgeInsets.zero, sliver: const SizedBox(), diff --git a/packages/flutter/test/widgets/center_test.dart b/packages/flutter/test/widgets/center_test.dart index 7daba7cb7e..1a9c42279c 100644 --- a/packages/flutter/test/widgets/center_test.dart +++ b/packages/flutter/test/widgets/center_test.dart @@ -10,7 +10,7 @@ void main() { await tester.pumpWidget( new Directionality( textDirection: TextDirection.ltr, - child: new ListView(children: [const Center()]) + child: new ListView(children: const [const Center()]) ), ); }); diff --git a/packages/flutter/test/widgets/dismissible_test.dart b/packages/flutter/test/widgets/dismissible_test.dart index 600b60ada9..f0333a5efe 100644 --- a/packages/flutter/test/widgets/dismissible_test.dart +++ b/packages/flutter/test/widgets/dismissible_test.dart @@ -518,7 +518,7 @@ void main() { width: 100.0, height: 1000.0, child: new Column( - children: [ + children: const [ const Test1215DismissibleWidget('1'), const Test1215DismissibleWidget('2'), ], diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index 7103741c50..cf817dcd0b 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -1224,7 +1224,7 @@ void main() { await tester.pumpWidget(new MaterialApp( home: new Column( - children: [ + children: const [ const Draggable( data: 1, child: const Text('Source'), diff --git a/packages/flutter/test/widgets/flex_test.dart b/packages/flutter/test/widgets/flex_test.dart index c87f4a863c..2d3c111000 100644 --- a/packages/flutter/test/widgets/flex_test.dart +++ b/packages/flutter/test/widgets/flex_test.dart @@ -51,7 +51,7 @@ void main() { await tester.pumpWidget( new Row( textDirection: TextDirection.ltr, - children: [ + children: const [ const Flexible(child: const SizedBox(width: 100.0, height: 200.0)), ], ), @@ -65,7 +65,7 @@ void main() { await tester.pumpWidget( new Row( textDirection: TextDirection.ltr, - children: [ + children: const [ const Expanded(flex: null, child: const Text('one', textDirection: TextDirection.ltr)), const Flexible(flex: null, child: const Text('two', textDirection: TextDirection.ltr)), ], diff --git a/packages/flutter/test/widgets/focus_test.dart b/packages/flutter/test/widgets/focus_test.dart index 7f7f9921eb..f7cc9824f7 100644 --- a/packages/flutter/test/widgets/focus_test.dart +++ b/packages/flutter/test/widgets/focus_test.dart @@ -58,7 +58,7 @@ void main() { testWidgets('Can have multiple focused children and they update accordingly', (WidgetTester tester) async { await tester.pumpWidget( new Column( - children: [ + children: const [ const TestFocusable( no: 'a', yes: 'A FOCUSED', @@ -146,7 +146,7 @@ void main() { autofocus: true, child: new Row( textDirection: TextDirection.ltr, - children: [ + children: const [ const TestFocusable( no: 'a', yes: 'A FOCUSED', @@ -221,7 +221,7 @@ void main() { node: parentFocusScope, child: new Row( textDirection: TextDirection.ltr, - children: [ + children: const [ const TestFocusable( no: 'a', yes: 'A FOCUSED', diff --git a/packages/flutter/test/widgets/image_headers_test.dart b/packages/flutter/test/widgets/image_headers_test.dart index c6f62954aa..38784f97dc 100644 --- a/packages/flutter/test/widgets/image_headers_test.dart +++ b/packages/flutter/test/widgets/image_headers_test.dart @@ -22,7 +22,7 @@ void main() { }); await tester.pumpWidget(new Image.network( 'https://www.example.com/images/frame.png', - headers: {'flutter': 'flutter'}, + headers: const {'flutter': 'flutter'}, )); }); } diff --git a/packages/flutter/test/widgets/implicit_semantics_test.dart b/packages/flutter/test/widgets/implicit_semantics_test.dart index 3de457ac89..1a431d308b 100644 --- a/packages/flutter/test/widgets/implicit_semantics_test.dart +++ b/packages/flutter/test/widgets/implicit_semantics_test.dart @@ -22,7 +22,7 @@ void main() { container: true, explicitChildNodes: false, child: new Column( - children: [ + children: const [ const Text('Michael Goderbauer'), const Text('goderbauer@google.com'), ], @@ -56,7 +56,7 @@ void main() { container: true, explicitChildNodes: true, child: new Column( - children: [ + children: const [ const Text('Michael Goderbauer'), const Text('goderbauer@google.com'), ], @@ -103,7 +103,7 @@ void main() { child: new Semantics( label: 'Signed in as', child: new Column( - children: [ + children: const [ const Text('Michael Goderbauer'), const Text('goderbauer@google.com'), ], @@ -146,7 +146,7 @@ void main() { child: new Semantics( label: 'Signed in as', child: new Column( - children: [ + children: const [ const Text('Michael Goderbauer'), const Text('goderbauer@google.com'), ], diff --git a/packages/flutter/test/widgets/list_view_misc_test.dart b/packages/flutter/test/widgets/list_view_misc_test.dart index 8878ecb35c..5818e88651 100644 --- a/packages/flutter/test/widgets/list_view_misc_test.dart +++ b/packages/flutter/test/widgets/list_view_misc_test.dart @@ -120,7 +120,7 @@ void main() { textDirection: TextDirection.ltr, child: new ListView( controller: controller, - children: [const Text('A'), const Text('B'), const Text('C')], + children: const [const Text('A'), const Text('B'), const Text('C')], ), ); } @@ -178,7 +178,7 @@ void main() { new Flexible( // The overall height of the ListView's contents is 500 child: new ListView( - children: [ + children: const [ const SizedBox( height: 150.0, child: const Center( diff --git a/packages/flutter/test/widgets/list_view_relayout_test.dart b/packages/flutter/test/widgets/list_view_relayout_test.dart index d341e2cf20..6dcc01ce16 100644 --- a/packages/flutter/test/widgets/list_view_relayout_test.dart +++ b/packages/flutter/test/widgets/list_view_relayout_test.dart @@ -16,7 +16,7 @@ void main() { children: [ new ListView( shrinkWrap: true, - children: [ + children: const [ const Text('1'), const Text('2'), const Text('3'), @@ -24,7 +24,7 @@ void main() { ), new ListView( shrinkWrap: true, - children: [ + children: const [ const Text('4'), const Text('5'), const Text('6'), @@ -43,7 +43,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 100.0, child: const Text('100')), ], ), @@ -54,7 +54,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 200.0, child: const Text('200')), ], @@ -70,7 +70,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 100.0, child: const Text('100')), ], ), @@ -84,7 +84,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 200.0, child: const Text('200')), ], @@ -97,7 +97,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [] + children: const [] ), ), ); @@ -109,7 +109,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 300.0, child: const Text('300')), const SizedBox(height: 400.0, child: const Text('400')), ], @@ -124,7 +124,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 300.0, child: const Text('300')), ], ), @@ -138,7 +138,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [] + children: const [] ), ), ); @@ -152,7 +152,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 300.0, child: const Text('300')), const SizedBox(height: 400.0, child: const Text('400')), ], @@ -167,7 +167,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 300.0, child: const Text('300')), const SizedBox(height: 400.0, child: const Text('400')), const SizedBox(height: 100.0, child: const Text('100')), @@ -191,7 +191,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 100.0, child: const Text('100')), ], ), @@ -205,7 +205,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new ListView( - children: [ + children: const [ const SizedBox(height: 100.0, child: const Text('100')), const SizedBox(height: 200.0, child: const Text('200')), const SizedBox(height: 400.0, child: const Text('400')), diff --git a/packages/flutter/test/widgets/list_view_test.dart b/packages/flutter/test/widgets/list_view_test.dart index a635ec9638..4562d5bcbb 100644 --- a/packages/flutter/test/widgets/list_view_test.dart +++ b/packages/flutter/test/widgets/list_view_test.dart @@ -188,7 +188,7 @@ void main() { height: 0.0, child: new ListView( padding: const EdgeInsets.all(8.0), - children: [ + children: const [ const Text('padded', textDirection: TextDirection.ltr), ], ), diff --git a/packages/flutter/test/widgets/overscroll_indicator_test.dart b/packages/flutter/test/widgets/overscroll_indicator_test.dart index 77e50aec33..ae4ad07c4e 100644 --- a/packages/flutter/test/widgets/overscroll_indicator_test.dart +++ b/packages/flutter/test/widgets/overscroll_indicator_test.dart @@ -27,7 +27,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new CustomScrollView( - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), ], ), @@ -57,7 +57,7 @@ void main() { await tester.pumpAndSettle(const Duration(seconds: 1)); expect(painter, doesNotOverscroll); }); - + testWidgets('Nested scrollable', (WidgetTester tester) async { await tester.pumpWidget( new Directionality( @@ -71,7 +71,7 @@ void main() { child: new Container( width: 600.0, child: new CustomScrollView( - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), ], ), @@ -80,21 +80,21 @@ void main() { ), ), ); - + final RenderObject outerPainter = tester.renderObject(find.byType(CustomPaint).first); final RenderObject innerPainter = tester.renderObject(find.byType(CustomPaint).last); - + await slowDrag(tester, const Offset(200.0, 200.0), const Offset(0.0, 5.0)); expect(outerPainter, paints..circle()); expect(innerPainter, paints..circle()); }); - + testWidgets('Overscroll indicator changes side when you drag on the other side', (WidgetTester tester) async { await tester.pumpWidget( new Directionality( textDirection: TextDirection.ltr, child: new CustomScrollView( - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), ], ), @@ -132,7 +132,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new CustomScrollView( - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), ], ), @@ -169,7 +169,7 @@ void main() { textDirection: TextDirection.ltr, child: new CustomScrollView( physics: const AlwaysScrollableScrollPhysics(), - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), ], ), @@ -190,7 +190,7 @@ void main() { child: new CustomScrollView( reverse: true, physics: const AlwaysScrollableScrollPhysics(), - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), ], ), @@ -211,7 +211,7 @@ void main() { textDirection: TextDirection.ltr, child: new CustomScrollView( physics: const AlwaysScrollableScrollPhysics(), - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), ], ), @@ -235,7 +235,7 @@ void main() { child: new CustomScrollView( scrollDirection: Axis.horizontal, physics: const AlwaysScrollableScrollPhysics(), - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), ], ), @@ -287,7 +287,7 @@ void main() { scrollDirection: Axis.horizontal, physics: const AlwaysScrollableScrollPhysics(), reverse: true, - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), ], ), @@ -308,7 +308,7 @@ void main() { child: new CustomScrollView( scrollDirection: Axis.horizontal, physics: const AlwaysScrollableScrollPhysics(), - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 20.0)), ], ), diff --git a/packages/flutter/test/widgets/page_view_test.dart b/packages/flutter/test/widgets/page_view_test.dart index 84cc2f3c34..b3585d8fa5 100644 --- a/packages/flutter/test/widgets/page_view_test.dart +++ b/packages/flutter/test/widgets/page_view_test.dart @@ -611,7 +611,7 @@ void main() { child: new PageView( key: const PageStorageKey('PageView'), controller: controller, - children: [ + children: const [ const Placeholder(), const Placeholder(), const Placeholder(), @@ -645,7 +645,7 @@ void main() { child: new PageView( key: const PageStorageKey('PageView'), controller: controller, - children: [ + children: const [ const Placeholder(), const Placeholder(), const Placeholder(), @@ -663,7 +663,7 @@ void main() { child: new PageView( key: const PageStorageKey('Check it again against your list and see consistency!'), controller: controller2, - children: [ + children: const [ const Placeholder(), const Placeholder(), const Placeholder(), diff --git a/packages/flutter/test/widgets/placeholder_test.dart b/packages/flutter/test/widgets/placeholder_test.dart index a286af7463..ae1b9359c0 100644 --- a/packages/flutter/test/widgets/placeholder_test.dart +++ b/packages/flutter/test/widgets/placeholder_test.dart @@ -13,11 +13,11 @@ void main() { expect(tester.renderObject(find.byType(Placeholder)).size, const Size(800.0, 600.0)); await tester.pumpWidget(const Center(child: const Placeholder())); expect(tester.renderObject(find.byType(Placeholder)).size, const Size(800.0, 600.0)); - await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: [const Positioned(top: 0.0, bottom: 0.0, child: const Placeholder())])); + await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: const [const Positioned(top: 0.0, bottom: 0.0, child: const Placeholder())])); expect(tester.renderObject(find.byType(Placeholder)).size, const Size(400.0, 600.0)); - await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: [const Positioned(left: 0.0, right: 0.0, child: const Placeholder())])); + await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: const [const Positioned(left: 0.0, right: 0.0, child: const Placeholder())])); expect(tester.renderObject(find.byType(Placeholder)).size, const Size(800.0, 400.0)); - await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: [const Positioned(top: 0.0, child: const Placeholder(fallbackWidth: 200.0, fallbackHeight: 300.0))])); + await tester.pumpWidget(new Stack(textDirection: TextDirection.ltr, children: const [const Positioned(top: 0.0, child: const Placeholder(fallbackWidth: 200.0, fallbackHeight: 300.0))])); expect(tester.renderObject(find.byType(Placeholder)).size, const Size(200.0, 300.0)); }); diff --git a/packages/flutter/test/widgets/scroll_view_test.dart b/packages/flutter/test/widgets/scroll_view_test.dart index 141bbd72d3..761f5e5eb0 100644 --- a/packages/flutter/test/widgets/scroll_view_test.dart +++ b/packages/flutter/test/widgets/scroll_view_test.dart @@ -346,7 +346,7 @@ void main() { onNotification: (OverscrollNotification message) { scrolled = true; return false; }, child: new ListView( primary: true, - children: [], + children: const [], ), ), ), @@ -364,7 +364,7 @@ void main() { onNotification: (OverscrollNotification message) { scrolled = true; return false; }, child: new ListView( primary: false, - children: [], + children: const [], ), ), ), @@ -383,7 +383,7 @@ void main() { child: new ListView( primary: false, physics: const AlwaysScrollableScrollPhysics(), - children: [], + children: const [], ), ), ), @@ -402,7 +402,7 @@ void main() { child: new ListView( primary: true, physics: const ScrollPhysics(), - children: [], + children: const [], ), ), ), diff --git a/packages/flutter/test/widgets/scrollable_test.dart b/packages/flutter/test/widgets/scrollable_test.dart index 246143507b..c5f43956d9 100644 --- a/packages/flutter/test/widgets/scrollable_test.dart +++ b/packages/flutter/test/widgets/scrollable_test.dart @@ -12,7 +12,7 @@ Future pumpTest(WidgetTester tester, TargetPlatform platform) async { platform: platform, ), home: new CustomScrollView( - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 2000.0)), ], ), diff --git a/packages/flutter/test/widgets/shader_mask_test.dart b/packages/flutter/test/widgets/shader_mask_test.dart index cbce9fda22..3d4bbc5db5 100644 --- a/packages/flutter/test/widgets/shader_mask_test.dart +++ b/packages/flutter/test/widgets/shader_mask_test.dart @@ -8,11 +8,11 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/widgets.dart'; Shader createShader(Rect bounds) { - return new LinearGradient( + return const LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [const Color(0x00FFFFFF), const Color(0xFFFFFFFF)], - stops: [0.1, 0.35] + colors: const [const Color(0x00FFFFFF), const Color(0xFFFFFFFF)], + stops: const [0.1, 0.35] ).createShader(bounds); } diff --git a/packages/flutter/test/widgets/slivers_block_test.dart b/packages/flutter/test/widgets/slivers_block_test.dart index 2d0556ab31..b3632a0fe7 100644 --- a/packages/flutter/test/widgets/slivers_block_test.dart +++ b/packages/flutter/test/widgets/slivers_block_test.dart @@ -195,7 +195,7 @@ void main() { textDirection: TextDirection.ltr, child: new Viewport( offset: new ViewportOffset.zero(), - slivers: [ + slivers: const [ const SliverToBoxAdapter( child: const SizedBox(height: 400.0, child: const Text('a')), ), @@ -211,7 +211,7 @@ void main() { textDirection: TextDirection.ltr, child: new Viewport( offset: new ViewportOffset.fixed(100.0), - slivers: [ + slivers: const [ const SliverToBoxAdapter( child: const SizedBox(height: 400.0, child: const Text('a')), ), @@ -227,7 +227,7 @@ void main() { textDirection: TextDirection.ltr, child: new Viewport( offset: new ViewportOffset.fixed(100.0), - slivers: [ + slivers: const [ const SliverToBoxAdapter( child: const SizedBox(height: 4000.0, child: const Text('a')), ), @@ -243,7 +243,7 @@ void main() { textDirection: TextDirection.ltr, child: new Viewport( offset: new ViewportOffset.zero(), - slivers: [ + slivers: const [ const SliverToBoxAdapter( child: const SizedBox(height: 4000.0, child: const Text('a')), ), diff --git a/packages/flutter/test/widgets/slivers_padding_test.dart b/packages/flutter/test/widgets/slivers_padding_test.dart index d40be985d3..cf27fa3854 100644 --- a/packages/flutter/test/widgets/slivers_padding_test.dart +++ b/packages/flutter/test/widgets/slivers_padding_test.dart @@ -249,7 +249,7 @@ void main() { textDirection: TextDirection.ltr, child: new Viewport( offset: new ViewportOffset.fixed(0.0), - slivers: [ + slivers: const [ const SliverPadding(padding: const EdgeInsets.all(100.0)), const SliverToBoxAdapter(child: const SizedBox(width: 400.0, height: 400.0, child: const Text('x'))), ], @@ -266,7 +266,7 @@ void main() { child: new Viewport( axisDirection: AxisDirection.left, offset: new ViewportOffset.fixed(0.0), - slivers: [ + slivers: const [ 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'))), ], @@ -280,7 +280,7 @@ void main() { child: new Viewport( axisDirection: AxisDirection.left, offset: new ViewportOffset.fixed(0.0), - slivers: [ + slivers: const [ 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'))), ], @@ -297,7 +297,7 @@ void main() { child: new Viewport( axisDirection: AxisDirection.up, offset: new ViewportOffset.fixed(0.0), - slivers: [ + slivers: const [ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), ], ), @@ -310,7 +310,7 @@ void main() { child: new Viewport( axisDirection: AxisDirection.down, offset: new ViewportOffset.fixed(0.0), - slivers: [ + slivers: const [ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), ], ), @@ -323,7 +323,7 @@ void main() { child: new Viewport( axisDirection: AxisDirection.right, offset: new ViewportOffset.fixed(0.0), - slivers: [ + slivers: const [ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), ], ), @@ -336,7 +336,7 @@ void main() { child: new Viewport( axisDirection: AxisDirection.left, offset: new ViewportOffset.fixed(0.0), - slivers: [ + slivers: const [ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), ], ), @@ -349,7 +349,7 @@ void main() { child: new Viewport( axisDirection: AxisDirection.left, offset: new ViewportOffset.fixed(99999.9), - slivers: [ + slivers: const [ const SliverPadding(padding: const EdgeInsets.fromLTRB(1.0, 2.0, 4.0, 8.0)), ], ), diff --git a/packages/flutter/test/widgets/slivers_test.dart b/packages/flutter/test/widgets/slivers_test.dart index 5bc1e8ad71..9d8cfde76d 100644 --- a/packages/flutter/test/widgets/slivers_test.dart +++ b/packages/flutter/test/widgets/slivers_test.dart @@ -13,7 +13,7 @@ Future test(WidgetTester tester, double offset, { double anchor: 0.0 }) { child: new Viewport( anchor: anchor / 600.0, offset: new ViewportOffset.fixed(offset), - slivers: [ + slivers: const [ const SliverToBoxAdapter(child: const SizedBox(height: 400.0)), const SliverToBoxAdapter(child: const SizedBox(height: 400.0)), const SliverToBoxAdapter(child: const SizedBox(height: 400.0)), diff --git a/packages/flutter/test/widgets/stack_test.dart b/packages/flutter/test/widgets/stack_test.dart index a3e4cdf81f..fac7a88765 100644 --- a/packages/flutter/test/widgets/stack_test.dart +++ b/packages/flutter/test/widgets/stack_test.dart @@ -636,7 +636,7 @@ void main() { textDirection: TextDirection.rtl, child: new Stack( alignment: Alignment.center, - children: [ + children: const [ 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)), @@ -665,7 +665,7 @@ void main() { textDirection: TextDirection.ltr, child: new Stack( alignment: Alignment.center, - children: [ + children: const [ 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)), @@ -694,7 +694,7 @@ void main() { textDirection: TextDirection.ltr, child: new Stack( alignment: Alignment.bottomRight, - children: [ + children: const [ 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)), @@ -723,7 +723,7 @@ void main() { textDirection: TextDirection.ltr, child: new Stack( alignment: Alignment.topLeft, - children: [ + children: const [ 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)), diff --git a/packages/flutter/test/widgets/table_test.dart b/packages/flutter/test/widgets/table_test.dart index 5ce9a7fa11..130a3b8b77 100644 --- a/packages/flutter/test/widgets/table_test.dart +++ b/packages/flutter/test/widgets/table_test.dart @@ -25,19 +25,19 @@ void main() { new Directionality( textDirection: textDirection, child: new Table( - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('AAAAAA'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('EEE'), const Text('F'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -71,19 +71,19 @@ void main() { 2: const FixedColumnWidth(125.0), }, defaultColumnWidth: const FixedColumnWidth(333.0), - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('A1'), const Text('B1'), const Text('C1'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('A2'), const Text('B2'), const Text('C2'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('A3'), const Text('B3'), const Text('C3'), ], ), @@ -141,19 +141,19 @@ void main() { 2: const FixedColumnWidth(125.0), }, defaultColumnWidth: const FixedColumnWidth(333.0), - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('A1'), const Text('B1'), const Text('C1'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('A2'), const Text('B2'), const Text('C2'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('A3'), const Text('B3'), const Text('C3'), ], ), @@ -206,19 +206,19 @@ void main() { textDirection: textDirection, child: new Table( border: new TableBorder.all(), - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('AAAAAA'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('EEE'), const Text('F'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -238,19 +238,19 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Table( - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('A'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('E'), const Text('F'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('I'), ], ), @@ -266,14 +266,14 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Table( - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('a'), const Text('b'), const Text('c'), const Text('d'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('e'), const Text('f'), const Text('g'), const Text('h'), ], ), @@ -294,19 +294,19 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Table( - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('AAAAAA'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('EEE'), const Text('F'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -318,19 +318,19 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Table( - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const[ const Text('AAA'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('E'), const Text('FFFFFF'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -353,19 +353,19 @@ void main() { textDirection: TextDirection.ltr, child: new Table( defaultColumnWidth: const IntrinsicColumnWidth(), - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('AAA'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('E'), const Text('FFFFFF'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -389,19 +389,19 @@ void main() { textDirection: TextDirection.ltr, child: new Table( defaultColumnWidth: const IntrinsicColumnWidth(), - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('AAAAAA'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('EEE'), const Text('F'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -414,19 +414,19 @@ void main() { textDirection: TextDirection.ltr, child: new Table( defaultColumnWidth: const IntrinsicColumnWidth(), - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('A'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('EEE'), const Text('F'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -449,19 +449,19 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Table( - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('AAA'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('E'), const Text('FFFFFF'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -474,19 +474,19 @@ void main() { textDirection: TextDirection.ltr, child: new Table( defaultColumnWidth: const IntrinsicColumnWidth(), - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('AAA'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('E'), const Text('FFFFFF'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), @@ -522,8 +522,8 @@ void main() { ), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('b'), ], ), @@ -536,8 +536,8 @@ void main() { textDirection: TextDirection.ltr, child: new Table( children: [ - new TableRow( - children: [ + const TableRow( + children: const [ const Text('b'), ], ), @@ -565,17 +565,17 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Table( - children: [ - new TableRow( + children: const [ + const TableRow( key: const ValueKey(1), - children: [ + children: const [ const TestStatefulWidget(key: const ValueKey(11)), const TestStatefulWidget(key: const ValueKey(12)), ], ), - new TableRow( + const TableRow( key: const ValueKey(2), - children: [ + children: const [ const TestStatefulWidget(key: const ValueKey(21)), const TestStatefulWidget(key: const ValueKey(22)), ], @@ -599,10 +599,10 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Table( - children: [ - new TableRow( + children: const [ + const TableRow( key: const ValueKey(2), - children: [ + children: const [ const TestStatefulWidget(key: const ValueKey(21)), const TestStatefulWidget(key: const ValueKey(22)), ], @@ -738,19 +738,19 @@ void main() { child: new Table( key: key0 = new GlobalKey(), defaultColumnWidth: const IntrinsicColumnWidth(), - children: [ - new TableRow( - children: [ + children: const [ + const TableRow( + children: const [ const Text('A'), const Text('B'), const Text('C'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('D'), const Text('EEE'), const Text('F'), ], ), - new TableRow( - children: [ + const TableRow( + children: const [ const Text('G'), const Text('H'), const Text('III'), ], ), diff --git a/packages/flutter/test/widgets/widget_inspector_test.dart b/packages/flutter/test/widgets/widget_inspector_test.dart index 29d46479c0..00c31e2270 100644 --- a/packages/flutter/test/widgets/widget_inspector_test.dart +++ b/packages/flutter/test/widgets/widget_inspector_test.dart @@ -16,7 +16,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Stack( - children: [ + children: const [ const Text('a', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr), @@ -31,7 +31,7 @@ void main() { child: new WidgetInspector( selectButtonBuilder: null, child: new Stack( - children: [ + children: const [ const Text('a', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr), @@ -353,7 +353,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Stack( - children: [ + children: const [ const Text('a', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr), @@ -403,7 +403,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Stack( - children: [ + children: const [ const Text('a', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr), @@ -476,7 +476,7 @@ void main() { new Directionality( textDirection: TextDirection.ltr, child: new Stack( - children: [ + children: const [ const Text('a', textDirection: TextDirection.ltr), const Text('b', textDirection: TextDirection.ltr), const Text('c', textDirection: TextDirection.ltr), diff --git a/packages/flutter/test/widgets/wrap_test.dart b/packages/flutter/test/widgets/wrap_test.dart index 0c9566e298..21445c03ff 100644 --- a/packages/flutter/test/widgets/wrap_test.dart +++ b/packages/flutter/test/widgets/wrap_test.dart @@ -21,7 +21,7 @@ void main() { new Wrap( alignment: WrapAlignment.start, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -40,7 +40,7 @@ void main() { new Wrap( alignment: WrapAlignment.center, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -59,7 +59,7 @@ void main() { new Wrap( alignment: WrapAlignment.end, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -79,7 +79,7 @@ void main() { alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 300.0, height: 50.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -99,7 +99,7 @@ void main() { alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.center, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 300.0, height: 50.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -119,7 +119,7 @@ void main() { alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.end, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 300.0, height: 50.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -141,7 +141,7 @@ void main() { new Wrap( alignment: WrapAlignment.start, textDirection: TextDirection.rtl, - children: [ + children: const [ const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -160,7 +160,7 @@ void main() { new Wrap( alignment: WrapAlignment.center, textDirection: TextDirection.rtl, - children: [ + children: const [ const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -179,7 +179,7 @@ void main() { new Wrap( alignment: WrapAlignment.end, textDirection: TextDirection.rtl, - children: [ + children: const [ const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -200,7 +200,7 @@ void main() { crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, - children: [ + children: const [ const SizedBox(width: 300.0, height: 50.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -221,7 +221,7 @@ void main() { crossAxisAlignment: WrapCrossAlignment.center, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, - children: [ + children: const [ const SizedBox(width: 300.0, height: 50.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -242,7 +242,7 @@ void main() { crossAxisAlignment: WrapCrossAlignment.end, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, - children: [ + children: const [ const SizedBox(width: 300.0, height: 50.0), const SizedBox(width: 300.0, height: 100.0), const SizedBox(width: 300.0, height: 100.0), @@ -269,7 +269,7 @@ void main() { alignment: WrapAlignment.center, spacing: 5.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -286,7 +286,7 @@ void main() { alignment: WrapAlignment.spaceBetween, spacing: 5.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -303,7 +303,7 @@ void main() { alignment: WrapAlignment.spaceAround, spacing: 5.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 310.0, height: 30.0), @@ -320,7 +320,7 @@ void main() { alignment: WrapAlignment.spaceEvenly, spacing: 5.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 310.0, height: 30.0), @@ -339,7 +339,7 @@ void main() { alignment: WrapAlignment.center, spacing: 5.0, textDirection: TextDirection.rtl, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -356,7 +356,7 @@ void main() { alignment: WrapAlignment.spaceBetween, spacing: 5.0, textDirection: TextDirection.rtl, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -373,7 +373,7 @@ void main() { alignment: WrapAlignment.spaceAround, spacing: 5.0, textDirection: TextDirection.rtl, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 310.0, height: 30.0), @@ -390,7 +390,7 @@ void main() { alignment: WrapAlignment.spaceEvenly, spacing: 5.0, textDirection: TextDirection.rtl, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 310.0, height: 30.0), @@ -409,7 +409,7 @@ void main() { runAlignment: WrapAlignment.center, runSpacing: 5.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -430,7 +430,7 @@ void main() { runAlignment: WrapAlignment.spaceBetween, runSpacing: 5.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -451,7 +451,7 @@ void main() { runAlignment: WrapAlignment.spaceAround, runSpacing: 5.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -472,7 +472,7 @@ void main() { runAlignment: WrapAlignment.spaceEvenly, runSpacing: 5.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -497,7 +497,7 @@ void main() { runSpacing: 5.0, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -519,7 +519,7 @@ void main() { runSpacing: 5.0, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -541,7 +541,7 @@ void main() { runSpacing: 5.0, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -563,7 +563,7 @@ void main() { runSpacing: 5.0, textDirection: TextDirection.ltr, verticalDirection: VerticalDirection.up, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -590,7 +590,7 @@ void main() { alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.end, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 100.0, height: 10.0), const SizedBox(width: 200.0, height: 20.0), const SizedBox(width: 300.0, height: 30.0), @@ -614,7 +614,7 @@ void main() { alignment: WrapAlignment.end, crossAxisAlignment: WrapCrossAlignment.end, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 400.0, height: 40.0), const SizedBox(width: 300.0, height: 30.0), const SizedBox(width: 200.0, height: 20.0), @@ -641,7 +641,7 @@ void main() { alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 500.0, height: 10.0), const SizedBox(width: 500.0, height: 20.0), const SizedBox(width: 500.0, height: 30.0), @@ -670,7 +670,7 @@ void main() { alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 10.0, height: 250.0), const SizedBox(width: 20.0, height: 250.0), const SizedBox(width: 30.0, height: 250.0), @@ -699,7 +699,7 @@ void main() { spacing: 12.0, runSpacing: 8.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 10.0, height: 250.0), const SizedBox(width: 20.0, height: 250.0), const SizedBox(width: 30.0, height: 250.0), @@ -724,7 +724,7 @@ void main() { testWidgets('Visual overflow generates a clip', (WidgetTester tester) async { await tester.pumpWidget(new Wrap( textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 500.0, height: 500.0), ], )); @@ -733,7 +733,7 @@ void main() { await tester.pumpWidget(new Wrap( textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 500.0, height: 500.0), const SizedBox(width: 500.0, height: 500.0), ], @@ -790,7 +790,7 @@ void main() { direction: Axis.vertical, runSpacing: 7.0, textDirection: TextDirection.ltr, - children: [ + children: const [ const SizedBox(width: 500.0, height: 400.0), const SizedBox(width: 500.0, height: 400.0), const SizedBox(width: 500.0, height: 400.0), @@ -816,7 +816,7 @@ void main() { ), child: new Wrap( textDirection: TextDirection.ltr, - children: [ + children: const [ const Text('X', textDirection: TextDirection.ltr), ], ), diff --git a/packages/flutter_localizations/test/time_picker_test.dart b/packages/flutter_localizations/test/time_picker_test.dart index f3c2adaac8..4395b94467 100644 --- a/packages/flutter_localizations/test/time_picker_test.dart +++ b/packages/flutter_localizations/test/time_picker_test.dart @@ -134,7 +134,7 @@ void main() { await tester.pumpWidget( new Localizations( locale: const Locale('en', 'US'), - delegates: >[ + delegates: const >[ GlobalMaterialLocalizations.delegate, DefaultWidgetsLocalizations.delegate, ], diff --git a/packages/flutter_localizations/test/widgets_test.dart b/packages/flutter_localizations/test/widgets_test.dart index a1e955f31c..aa57d2d185 100644 --- a/packages/flutter_localizations/test/widgets_test.dart +++ b/packages/flutter_localizations/test/widgets_test.dart @@ -606,7 +606,7 @@ void main() { buildContent: (BuildContext context) { return new Localizations.override( context: context, - delegates: [ + delegates: const [ // Override: no matter what the locale, textDirection is always RTL. const OnlyRTLDefaultWidgetsLocalizationsDelegate(), ], diff --git a/packages/flutter_test/test/widget_tester_test.dart b/packages/flutter_test/test/widget_tester_test.dart index 85e3800580..a9ef219427 100644 --- a/packages/flutter_test/test/widget_tester_test.dart +++ b/packages/flutter_test/test/widget_tester_test.dart @@ -177,7 +177,7 @@ void main() { await tester.pumpWidget(new Row( textDirection: TextDirection.ltr, children: [ - new Column(children: [const Text('foo', textDirection: TextDirection.ltr)]), + new Column(children: const [const Text('foo', textDirection: TextDirection.ltr)]), const Text('bar', textDirection: TextDirection.ltr), ], )); @@ -237,7 +237,7 @@ void main() { await tester.pumpWidget(new Row( textDirection: TextDirection.ltr, children: [ - new Column(children: [const Text('foo', textDirection: TextDirection.ltr)]), + new Column(children: const [const Text('foo', textDirection: TextDirection.ltr)]), const Text('bar', textDirection: TextDirection.ltr), ], ));