From 157bc92d4a844f2284a505e3f460eeb3882be475 Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Thu, 13 May 2021 22:39:04 +0200 Subject: [PATCH] end of sort_child_properties_last (#82457) --- .../lib/src/filtered_child_animation.dart | 4 +- .../lib/src/multi_widget_construction.dart | 6 +- .../test_apps/stocks/lib/stock_home.dart | 2 +- .../test_apps/stocks/lib/stock_row.dart | 4 +- .../stocks/lib/stock_symbol_viewer.dart | 4 +- .../android_views/lib/motion_events_page.dart | 2 +- .../android_views/lib/wm_integrations.dart | 6 +- .../external_ui/lib/main.dart | 2 +- .../demo/cupertino/cupertino_alert_demo.dart | 16 ++--- .../cupertino/cupertino_buttons_demo.dart | 4 +- .../cupertino/cupertino_navigation_demo.dart | 4 +- .../cupertino/cupertino_text_field_demo.dart | 4 +- .../demo/material/bottom_app_bar_demo.dart | 4 +- .../lib/demo/material/buttons_demo.dart | 8 +-- .../lib/demo/material/page_selector_demo.dart | 2 +- .../material/progress_indicator_demo.dart | 5 +- .../demo/material/reorderable_list_demo.dart | 3 +- .../lib/demo/material/snack_bar_demo.dart | 2 +- .../lib/demo/material/tabs_fab_demo.dart | 2 +- .../demo/material/text_form_field_demo.dart | 2 +- .../demo/shrine/expanding_bottom_sheet.dart | 2 +- .../flutter_gallery/lib/demo/shrine/home.dart | 2 +- .../lib/demo/shrine/login.dart | 2 +- .../shrine/supplemental/asymmetric_view.dart | 2 +- .../transformations/transformations_demo.dart | 6 +- ...formations_demo_gesture_transformable.dart | 2 +- .../flutter_gallery/lib/demo/video_demo.dart | 4 +- .../flutter_gallery/lib/gallery/backdrop.dart | 2 +- .../lib/gallery/example_code.dart | 8 +-- .../flutter_gallery/lib/gallery/home.dart | 4 +- .../flutter_gallery/lib/gallery/options.dart | 2 +- .../lib/motion_events_page.dart | 2 +- .../lib/nested_view_event_page.dart | 8 +-- .../ios_platform_view_tests/lib/main.dart | 2 +- dev/manual_tests/lib/actions.dart | 4 +- dev/manual_tests/lib/card_collection.dart | 2 +- dev/manual_tests/lib/density.dart | 8 +-- dev/manual_tests/lib/hover.dart | 4 +- dev/manual_tests/lib/page_view.dart | 2 +- examples/layers/services/isolate.dart | 2 +- examples/layers/widgets/gestures.dart | 2 +- examples/layers/widgets/sectors.dart | 4 +- examples/layers/widgets/spinning_mixed.dart | 4 +- examples/platform_channel/lib/main.dart | 2 +- examples/platform_channel_swift/lib/main.dart | 2 +- examples/platform_view/lib/main.dart | 2 +- .../lib/src/material/bottom_sheet.dart | 2 +- .../test/material/bottom_app_bar_test.dart | 10 +-- .../test/material/bottom_sheet_test.dart | 2 +- .../test/material/button_theme_test.dart | 2 +- .../flutter/test/material/dialog_test.dart | 6 +- .../material/dropdown_form_field_test.dart | 2 +- .../flutter/test/material/dropdown_test.dart | 14 ++-- .../test/material/elevated_button_test.dart | 6 +- .../test/material/flat_button_test.dart | 10 +-- .../floating_action_button_location_test.dart | 4 +- .../floating_action_button_theme_test.dart | 2 +- .../test/material/inherited_theme_test.dart | 4 +- .../flutter/test/material/ink_well_test.dart | 2 +- .../test/material/material_button_test.dart | 4 +- .../flutter/test/material/material_test.dart | 26 ++++---- .../test/material/outline_button_test.dart | 16 ++--- .../test/material/outlined_button_test.dart | 6 +- .../test/material/popup_menu_test.dart | 26 ++++---- .../test/material/raised_button_test.dart | 8 +-- .../material/raw_material_button_test.dart | 2 +- .../test/material/reorderable_list_test.dart | 64 +++++++++---------- .../test/material/text_button_test.dart | 6 +- ...xt_selection_toolbar_text_button_test.dart | 2 +- .../flutter/test/material/tooltip_test.dart | 2 +- packages/flutter/test/widgets/align_test.dart | 14 ++-- .../test/widgets/animated_container_test.dart | 4 +- .../widgets/animated_positioned_test.dart | 42 ++++++------ .../test/widgets/animated_switcher_test.dart | 50 +++++++-------- .../test/widgets/annotated_region_test.dart | 4 +- packages/flutter/test/widgets/clip_test.dart | 4 +- .../custom_multi_child_layout_test.dart | 14 ++-- .../test/widgets/custom_painter_test.dart | 8 +-- .../test/widgets/default_text_style_test.dart | 4 +- .../draggable_scrollable_sheet_test.dart | 2 +- .../editable_text_show_on_screen_test.dart | 2 +- .../test/widgets/ensure_visible_test.dart | 2 +- .../flutter/test/widgets/fitted_box_test.dart | 2 +- packages/flutter/test/widgets/flow_test.dart | 4 +- .../test/widgets/gesture_detector_test.dart | 4 +- .../flutter/test/widgets/grid_view_test.dart | 6 +- .../flutter/test/widgets/heroes_test.dart | 2 +- .../widgets/implicit_animations_test.dart | 22 +++---- .../flutter/test/widgets/inherited_test.dart | 4 +- .../flutter/test/widgets/list_view_test.dart | 2 +- .../widgets/list_wheel_scroll_view_test.dart | 2 +- .../test/widgets/mouse_region_test.dart | 8 +-- .../flutter/test/widgets/opacity_test.dart | 14 ++-- .../widgets/overscroll_indicator_test.dart | 4 +- .../flutter/test/widgets/page_view_test.dart | 17 +++-- .../test/widgets/platform_view_test.dart | 2 +- ...range_maintaining_scroll_physics_test.dart | 2 +- .../test/widgets/reorderable_list_test.dart | 10 +-- .../flutter/test/widgets/routes_test.dart | 2 +- .../test/widgets/scroll_activity_test.dart | 4 +- .../widgets/scroll_notification_test.dart | 4 +- .../test/widgets/scroll_view_test.dart | 2 +- .../widgets/scrollable_animations_test.dart | 6 +- .../scrollable_list_hit_testing_test.dart | 4 +- .../widgets/scrollable_semantics_test.dart | 6 +- .../test/widgets/semantics_1_test.dart | 2 +- .../test/widgets/shader_mask_test.dart | 2 +- .../widgets/sliver_appbar_opacity_test.dart | 2 +- .../widgets/sliver_fill_remaining_test.dart | 6 +- .../slivers_appbar_floating_pinned_test.dart | 2 +- .../test/widgets/slivers_evil_test.dart | 2 +- .../test/widgets/slivers_keepalive_test.dart | 28 ++++---- packages/flutter/test/widgets/stack_test.dart | 6 +- packages/flutter/test/widgets/title_test.dart | 4 +- .../test/widgets/transitions_test.dart | 2 +- .../flutter/test/widgets/visibility_test.dart | 34 +++++----- .../test/src/real_tests/extension_test.dart | 4 +- .../flutter_test/lib/src/animation_sheet.dart | 2 +- .../flutter_test/test/accessibility_test.dart | 6 +- packages/flutter_test/test/finders_test.dart | 2 +- 120 files changed, 395 insertions(+), 392 deletions(-) diff --git a/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart b/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart index c3e3f4cdfc..f0d35f844c 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/filtered_child_animation.dart @@ -87,8 +87,8 @@ class _FilteredChildAnimationPageState extends State children: List.generate(rows, (int r) => Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: List.generate(cols, (int c) => Container( - child: Text('text', style: TextStyle(fontSize: fontSize)), decoration: decoration, + child: Text('text', style: TextStyle(fontSize: fontSize)), )), )), ), @@ -138,8 +138,8 @@ class _FilteredChildAnimationPageState extends State return RepaintBoundary( child: AnimatedBuilder( animation: _controller, - child: protectChild ? RepaintBoundary(child: child) : child, builder: builder, + child: protectChild ? RepaintBoundary(child: child) : child, ), ); } diff --git a/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart b/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart index f9407e3a28..f28fa53554 100644 --- a/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart +++ b/dev/benchmarks/macrobenchmarks/lib/src/multi_widget_construction.dart @@ -75,16 +75,16 @@ class _MultiWidgetConstructTableState extends State key: ValueKey(widgetCounter + label), color: Color.lerp( Colors.white, baseColor, label / totalLength), - child: Text('${widgetCounter + label}'), constraints: BoxConstraints.expand(height: height), + child: Text('${widgetCounter + label}'), ) : MyContainer( // This key forces rebuilding the element key: ValueKey(widgetCounter + label), color: Color.lerp( Colors.white, baseColor, label / totalLength), - child: Text('${widgetCounter + label}'), constraints: BoxConstraints.expand(height: height), + child: Text('${widgetCounter + label}'), ); }, ), @@ -109,8 +109,8 @@ class MyContainer extends StatelessWidget { Widget build(BuildContext context) { return Container( color: color, - child: child, constraints: constraints, + child: child, ); } } diff --git a/dev/benchmarks/test_apps/stocks/lib/stock_home.dart b/dev/benchmarks/test_apps/stocks/lib/stock_home.dart index ffa9e0c444..670f58d9fa 100644 --- a/dev/benchmarks/test_apps/stocks/lib/stock_home.dart +++ b/dev/benchmarks/test_apps/stocks/lib/stock_home.dart @@ -310,9 +310,9 @@ class StockHomeState extends State { Widget buildFloatingActionButton() { return FloatingActionButton( tooltip: 'Create company', - child: const Icon(Icons.add), backgroundColor: Theme.of(context).colorScheme.secondary, onPressed: _handleCreateCompany, + child: const Icon(Icons.add), ); } diff --git a/dev/benchmarks/test_apps/stocks/lib/stock_row.dart b/dev/benchmarks/test_apps/stocks/lib/stock_row.dart index 152ac65a44..8d1fce19cd 100644 --- a/dev/benchmarks/test_apps/stocks/lib/stock_row.dart +++ b/dev/benchmarks/test_apps/stocks/lib/stock_row.dart @@ -57,6 +57,8 @@ class StockRow extends StatelessWidget { ), Expanded( child: Row( + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: DefaultTextStyle.of(context).style.textBaseline, children: [ Expanded( flex: 2, @@ -77,8 +79,6 @@ class StockRow extends StatelessWidget { ), ), ], - crossAxisAlignment: CrossAxisAlignment.baseline, - textBaseline: DefaultTextStyle.of(context).style.textBaseline, ), ), ], diff --git a/dev/benchmarks/test_apps/stocks/lib/stock_symbol_viewer.dart b/dev/benchmarks/test_apps/stocks/lib/stock_symbol_viewer.dart index fe7f5bf725..d546550928 100644 --- a/dev/benchmarks/test_apps/stocks/lib/stock_symbol_viewer.dart +++ b/dev/benchmarks/test_apps/stocks/lib/stock_symbol_viewer.dart @@ -28,8 +28,10 @@ class _StockSymbolView extends StatelessWidget { return Container( padding: const EdgeInsets.all(20.0), child: Column( + mainAxisSize: MainAxisSize.min, children: [ Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( stock.symbol, @@ -38,7 +40,6 @@ class _StockSymbolView extends StatelessWidget { ), arrow, ], - mainAxisAlignment: MainAxisAlignment.spaceBetween, ), Text('Last Sale', style: headings), Text('$lastSale ($changeInPrice)'), @@ -61,7 +62,6 @@ class _StockSymbolView extends StatelessWidget { ), ), ], - mainAxisSize: MainAxisSize.min, ), ); } diff --git a/dev/integration_tests/android_views/lib/motion_events_page.dart b/dev/integration_tests/android_views/lib/motion_events_page.dart index 3aac04655d..210ad68883 100644 --- a/dev/integration_tests/android_views/lib/motion_events_page.dart +++ b/dev/integration_tests/android_views/lib/motion_events_page.dart @@ -82,8 +82,8 @@ class MotionEventsBodyState extends State { children: [ Expanded( child: ElevatedButton( - child: const Text('RECORD'), onPressed: listenToFlutterViewEvents, + child: const Text('RECORD'), ), ), Expanded( diff --git a/dev/integration_tests/android_views/lib/wm_integrations.dart b/dev/integration_tests/android_views/lib/wm_integrations.dart index 4abada1a98..7856e15a74 100644 --- a/dev/integration_tests/android_views/lib/wm_integrations.dart +++ b/dev/integration_tests/android_views/lib/wm_integrations.dart @@ -57,20 +57,20 @@ class WindowManagerBodyState extends State { if (viewChannel != null) ... [ ElevatedButton( key: const ValueKey('ShowAlertDialog'), - child: const Text('SHOW ALERT DIALOG'), onPressed: onShowAlertDialogPressed, + child: const Text('SHOW ALERT DIALOG'), ), Row( children: [ ElevatedButton( key: const ValueKey('AddWindow'), - child: const Text('ADD WINDOW'), onPressed: onAddWindowPressed, + child: const Text('ADD WINDOW'), ), ElevatedButton( key: const ValueKey('TapWindow'), - child: const Text('TAP WINDOW'), onPressed: onTapWindowPressed, + child: const Text('TAP WINDOW'), ), if (windowClickCount > 0) Text( diff --git a/dev/integration_tests/external_ui/lib/main.dart b/dev/integration_tests/external_ui/lib/main.dart index 8711cf91f7..3e4f7661ef 100644 --- a/dev/integration_tests/external_ui/lib/main.dart +++ b/dev/integration_tests/external_ui/lib/main.dart @@ -157,8 +157,8 @@ Press play to produce texture frames.'''; ), floatingActionButton: _icon == null ? null : FloatingActionButton( key: const ValueKey('fab'), - child: Icon(_icon), onPressed: _nextState, + child: Icon(_icon), ), ), ); diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_alert_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_alert_demo.dart index 14320e74dd..045665d18c 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_alert_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_alert_demo.dart @@ -70,20 +70,20 @@ class _CupertinoAlertDemoState extends State { ), const Padding(padding: EdgeInsets.all(8.0)), CupertinoButton.filled( - child: const Text('Alert with Title'), padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0), + child: const Text('Alert with Title'), onPressed: () => _onAlertWithTitlePress(context), ), const Padding(padding: EdgeInsets.all(8.0)), CupertinoButton.filled( - child: const Text('Alert with Buttons'), padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0), + child: const Text('Alert with Buttons'), onPressed: () => _onAlertWithButtonsPress(context), ), const Padding(padding: EdgeInsets.all(8.0)), CupertinoButton.filled( - child: const Text('Alert Buttons Only'), padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0), + child: const Text('Alert Buttons Only'), onPressed: () { showDemoDialog( context: context, @@ -93,8 +93,8 @@ class _CupertinoAlertDemoState extends State { ), const Padding(padding: EdgeInsets.all(8.0)), CupertinoButton.filled( - child: const Text('Action Sheet'), padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0), + child: const Text('Action Sheet'), onPressed: () => _onActionSheetPress(context), ), ], @@ -120,13 +120,13 @@ class _CupertinoAlertDemoState extends State { title: const Text('Discard draft?'), actions: [ CupertinoDialogAction( - child: const Text('Discard'), isDestructiveAction: true, + child: const Text('Discard'), onPressed: () => Navigator.pop(context, 'Discard'), ), CupertinoDialogAction( - child: const Text('Cancel'), isDefaultAction: true, + child: const Text('Cancel'), onPressed: () => Navigator.pop(context, 'Cancel'), ), ], @@ -188,8 +188,8 @@ class _CupertinoAlertDemoState extends State { ), ], cancelButton: CupertinoActionSheetAction( - child: const Text('Cancel'), isDefaultAction: true, + child: const Text('Cancel'), onPressed: () => Navigator.pop(context, 'Cancel'), ), ), @@ -252,8 +252,8 @@ class CupertinoDessertDialog extends StatelessWidget { }, ), CupertinoDialogAction( - child: const Text('Cancel'), isDestructiveAction: true, + child: const Text('Cancel'), onPressed: () { Navigator.pop(context, 'Cancel'); }, diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart index a565718ab7..43e0a0cd5f 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_buttons_demo.dart @@ -61,8 +61,8 @@ class _CupertinoButtonDemoState extends State { }, ), const CupertinoButton( - child: Text('Disabled'), onPressed: null, + child: Text('Disabled'), ), ], ), @@ -76,8 +76,8 @@ class _CupertinoButtonDemoState extends State { ), const Padding(padding: EdgeInsets.all(12.0)), const CupertinoButton.filled( - child: Text('Disabled'), onPressed: null, + child: Text('Disabled'), ), ], ), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart index b5bda320f9..23227dfc2c 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart @@ -113,8 +113,8 @@ class ExitButton extends StatelessWidget { padding: EdgeInsets.zero, child: const Tooltip( message: 'Back', - child: Text('Exit'), excludeFromSemantics: true, + child: Text('Exit'), ), onPressed: () { // The demo is on the root navigator. @@ -808,8 +808,8 @@ class Tab3Dialog extends StatelessWidget { return CupertinoPageScaffold( navigationBar: CupertinoNavigationBar( leading: CupertinoButton( - child: const Text('Cancel'), padding: EdgeInsets.zero, + child: const Text('Cancel'), onPressed: () { Navigator.of(context).pop(false); }, diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_text_field_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_text_field_demo.dart index c063c8e602..a1cd7f7ea7 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_text_field_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_text_field_demo.dart @@ -45,13 +45,13 @@ class _CupertinoTextFieldDemoState extends State { padding: const EdgeInsets.symmetric(horizontal: 2.0), child: CupertinoButton( minSize: 0.0, + padding: const EdgeInsets.only(bottom: 4), + onPressed: () => setState(() => _chatTextController!.clear()), child: const Icon( CupertinoIcons.arrow_up_circle_fill, size: 28.0, color: CupertinoColors.activeGreen, ), - padding: const EdgeInsets.only(bottom: 4), - onPressed: ()=> setState(()=> _chatTextController!.clear()), ), ), autofocus: true, diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart index 5525e8113d..817e5d862a 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart @@ -35,8 +35,8 @@ class _BottomAppBarDemoState extends State { label: 'circular floating action button', value: FloatingActionButton( onPressed: _showSnackbar, - child: Icon(Icons.add, semanticLabel: 'Action'), backgroundColor: Colors.orange, + child: Icon(Icons.add, semanticLabel: 'Action'), ), ); @@ -431,6 +431,7 @@ class _DiamondFab extends StatelessWidget { return Material( shape: const _DiamondBorder(), color: Colors.orange, + elevation: 6.0, child: InkWell( onTap: onPressed, child: SizedBox( @@ -442,7 +443,6 @@ class _DiamondFab extends StatelessWidget { ), ), ), - elevation: 6.0, ); } } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart index d5b8391459..5b3525225e 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/buttons_demo.dart @@ -138,8 +138,8 @@ class _ButtonsDemoState extends State { }, ), const ElevatedButton( - child: Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 1'), onPressed: null, + child: Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 1'), ), ], ), @@ -185,8 +185,8 @@ class _ButtonsDemoState extends State { }, ), const TextButton( - child: Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 3',), onPressed: null, + child: Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 3',), ), ], ), @@ -233,8 +233,8 @@ class _ButtonsDemoState extends State { ), OutlinedButton( style: style, - child: const Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 5'), onPressed: null, + child: const Text('DISABLED', semanticsLabel: 'DISABLED BUTTON 5'), ), ], ), @@ -376,11 +376,11 @@ class _ButtonsDemoState extends State { return Align( alignment: const Alignment(0.0, -0.2), child: FloatingActionButton( + tooltip: 'floating action button', child: const Icon(Icons.add), onPressed: () { // Perform some action }, - tooltip: 'floating action button', ), ); } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/page_selector_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/page_selector_demo.dart index 36e0e51f04..2c0b77eac0 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/page_selector_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/page_selector_demo.dart @@ -29,6 +29,7 @@ class _PageSelector extends StatelessWidget { Container( margin: const EdgeInsets.only(top: 16.0), child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ IconButton( icon: const Icon(Icons.chevron_left), @@ -44,7 +45,6 @@ class _PageSelector extends StatelessWidget { tooltip: 'Page forward', ), ], - mainAxisAlignment: MainAxisAlignment.spaceBetween, ), ), Expanded( diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/progress_indicator_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/progress_indicator_demo.dart index ad01ca37e3..d7d242c6d4 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/progress_indicator_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/progress_indicator_demo.dart @@ -96,7 +96,10 @@ class _ProgressIndicatorDemoState extends State with Sing ]; return Column( children: indicators - .map((Widget c) => Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0))) + .map((Widget c) => Container( + margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0), + child: c, + )) .toList(), ); } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/reorderable_list_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/reorderable_list_demo.dart index 9a23b23fce..3808516d58 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/reorderable_list_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/reorderable_list_demo.dart @@ -150,8 +150,9 @@ class _ListDemoState extends State { key: Key(item.value), height: 100.0, width: 100.0, - child: CircleAvatar(child: Text(item.value), + child: CircleAvatar( backgroundColor: Colors.green, + child: Text(item.value), ), ); break; diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/snack_bar_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/snack_bar_demo.dart index a1a3a139f6..8adf4cf8b8 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/snack_bar_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/snack_bar_demo.dart @@ -84,8 +84,8 @@ class _SnackBarDemoState extends State { builder: buildBody ), floatingActionButton: FloatingActionButton( - child: const Icon(Icons.add), tooltip: 'Create', + child: const Icon(Icons.add), onPressed: () { print('Floating Action Button was pressed'); }, diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/tabs_fab_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/tabs_fab_demo.dart index 67ad32623f..49b3dad78c 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/tabs_fab_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/tabs_fab_demo.dart @@ -125,8 +125,8 @@ class _TabsFabDemoState extends State with SingleTickerProviderStat key: page.fabKey, tooltip: 'Show explanation', backgroundColor: page.fabColor, - child: page.fabIcon, onPressed: _showExplanatoryText, + child: page.fabIcon, ); } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart index 83426ee6df..2f5dc6a237 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/material/text_form_field_demo.dart @@ -280,8 +280,8 @@ class TextFormFieldDemoState extends State { const SizedBox(height: 24.0), Center( child: ElevatedButton( - child: const Text('SUBMIT'), onPressed: _handleSubmitted, + child: const Text('SUBMIT'), ), ), const SizedBox(height: 24.0), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart index 906541f6e7..0e7d14516e 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/expanding_bottom_sheet.dart @@ -277,8 +277,8 @@ class ExpandingBottomSheetState extends State with TickerP children: [ AnimatedPadding( padding: _cartPaddingFor(numProducts), - child: const Icon(Icons.shopping_cart), duration: const Duration(milliseconds: 225), + child: const Icon(Icons.shopping_cart), ), Container( // Accounts for the overflow number diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/home.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/home.dart index a31ef9f0e5..0bc08fa357 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/home.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/home.dart @@ -40,7 +40,7 @@ class HomePage extends StatelessWidget { children: [ if (backdrop != null) backdrop!, - Align(child: expandingBottomSheet, alignment: Alignment.bottomRight), + Align(alignment: Alignment.bottomRight, child: expandingBottomSheet), ], ); } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/login.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/login.dart index 7e082c4819..95437a40f7 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/login.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/login.dart @@ -133,8 +133,8 @@ class PrimaryColorOverride extends StatelessWidget { @override Widget build(BuildContext context) { return Theme( - child: child!, data: Theme.of(context).copyWith(primaryColor: color), + child: child!, ); } } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/asymmetric_view.dart b/dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/asymmetric_view.dart index 689183aa20..08671367a9 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/asymmetric_view.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/shrine/supplemental/asymmetric_view.dart @@ -78,8 +78,8 @@ class AsymmetricView extends StatelessWidget { return ListView( scrollDirection: Axis.horizontal, padding: const EdgeInsets.fromLTRB(0.0, 34.0, 16.0, 44.0), - children: _buildColumns(context), physics: const AlwaysScrollableScrollPhysics(), + children: _buildColumns(context), ); } } diff --git a/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart index ddf1afc4d3..ba11346a68 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart @@ -68,9 +68,6 @@ class _TransformationsDemoState extends State { _reset = false; }); }, - child: CustomPaint( - painter: painter, - ), boundaryRect: Rect.fromLTWH( -visibleSize.width / 2, -visibleSize.height / 2, @@ -83,6 +80,9 @@ class _TransformationsDemoState extends State { initialTranslation: Offset(size.width / 2, size.height / 2), onTapUp: _onTapUp, size: size, + child: CustomPaint( + painter: painter, + ), ); }, ), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo_gesture_transformable.dart b/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo_gesture_transformable.dart index d622c58813..2ab63f8603 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo_gesture_transformable.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo_gesture_transformable.dart @@ -288,9 +288,9 @@ class _GestureTransformableState extends State with Ticker child: Transform( transform: _transform, child: SizedBox( - child: widget.child, height: widget.size.height, width: widget.size.width, + child: widget.child, ), ), ), diff --git a/dev/integration_tests/flutter_gallery/lib/demo/video_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/video_demo.dart index 02bfab8394..0df6ff2183 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/video_demo.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/video_demo.dart @@ -127,11 +127,11 @@ class _VideoPlayerLoadingState extends State { return VideoPlayer(widget.controller!); } return Stack( + fit: StackFit.expand, children: [ VideoPlayer(widget.controller!), const Center(child: CircularProgressIndicator()), ], - fit: StackFit.expand, ); } } @@ -419,6 +419,7 @@ class _VideoDemoState extends State with SingleTickerProviderStateMix ), body: isSupported ? ConnectivityOverlay( + connectedCompleter: connectedCompleter, child: Scrollbar( child: ListView( children: [ @@ -435,7 +436,6 @@ class _VideoDemoState extends State with SingleTickerProviderStateMix ], ), ), - connectedCompleter: connectedCompleter, ) : const Center( child: Text( diff --git a/dev/integration_tests/flutter_gallery/lib/gallery/backdrop.dart b/dev/integration_tests/flutter_gallery/lib/gallery/backdrop.dart index 40422255bd..2d1f23ac4b 100644 --- a/dev/integration_tests/flutter_gallery/lib/gallery/backdrop.dart +++ b/dev/integration_tests/flutter_gallery/lib/gallery/backdrop.dart @@ -296,9 +296,9 @@ class _BackdropState extends State with SingleTickerProviderStateMixin AnimationStatus.dismissed, controller: _controller, child: Visibility( - child: widget.backLayer!, visible: _controller!.status != AnimationStatus.completed, maintainState: true, + child: widget.backLayer!, ), ), ), diff --git a/dev/integration_tests/flutter_gallery/lib/gallery/example_code.dart b/dev/integration_tests/flutter_gallery/lib/gallery/example_code.dart index 1a00a3bcc9..260622cf26 100644 --- a/dev/integration_tests/flutter_gallery/lib/gallery/example_code.dart +++ b/dev/integration_tests/flutter_gallery/lib/gallery/example_code.dart @@ -26,8 +26,8 @@ ElevatedButton( // Buttons are disabled when onPressed isn't // specified or is null. const ElevatedButton( - child: Text('BUTTON TITLE'), onPressed: null, + child: Text('BUTTON TITLE'), ); // Create a button with an icon and a @@ -54,8 +54,8 @@ OutlinedButton( // Buttons are disabled when onPressed isn't // specified or is null. const OutlinedButton( - child: Text('BUTTON TITLE'), onPressed: null, + child: Text('BUTTON TITLE'), ); // Create a button with an icon and a @@ -82,8 +82,8 @@ TextButton( // Buttons are disabled when onPressed isn't // specified or is null. const TextButton( - child: Text('BUTTON TITLE'), onPressed: null, + child: Text('BUTTON TITLE'), ); // END @@ -136,8 +136,8 @@ Scaffold( title: const Text('Demo'), ), floatingActionButton: const FloatingActionButton( - child: Icon(Icons.add), onPressed: null, + child: Icon(Icons.add), ), ); // END diff --git a/dev/integration_tests/flutter_gallery/lib/gallery/home.dart b/dev/integration_tests/flutter_gallery/lib/gallery/home.dart index c3f0380ee7..2011ce08e6 100644 --- a/dev/integration_tests/flutter_gallery/lib/gallery/home.dart +++ b/dev/integration_tests/flutter_gallery/lib/gallery/home.dart @@ -288,11 +288,11 @@ class _GalleryHomeState extends State with SingleTickerProviderStat static Widget _topHomeLayout(Widget? currentChild, List previousChildren) { return Stack( + alignment: Alignment.topCenter, children: [ ...previousChildren, if (currentChild != null) currentChild, ], - alignment: Alignment.topCenter, ); } @@ -400,8 +400,8 @@ class _GalleryHomeState extends State with SingleTickerProviderStat ); } home = AnnotatedRegion( - child: home, value: SystemUiOverlayStyle.light, + child: home, ); return home; diff --git a/dev/integration_tests/flutter_gallery/lib/gallery/options.dart b/dev/integration_tests/flutter_gallery/lib/gallery/options.dart index 6e7220d459..e921f9c397 100644 --- a/dev/integration_tests/flutter_gallery/lib/gallery/options.dart +++ b/dev/integration_tests/flutter_gallery/lib/gallery/options.dart @@ -203,8 +203,8 @@ class _Heading extends StatelessWidget { fontWeight: FontWeight.w700, ), child: Semantics( - child: Text(text), header: true, + child: Text(text), ), ), ); diff --git a/dev/integration_tests/hybrid_android_views/lib/motion_events_page.dart b/dev/integration_tests/hybrid_android_views/lib/motion_events_page.dart index 9746ad7dae..f370555e21 100644 --- a/dev/integration_tests/hybrid_android_views/lib/motion_events_page.dart +++ b/dev/integration_tests/hybrid_android_views/lib/motion_events_page.dart @@ -66,8 +66,8 @@ class MotionEventsBodyState extends State { children: [ Expanded( child: ElevatedButton( - child: const Text('RECORD'), onPressed: listenToFlutterViewEvents, + child: const Text('RECORD'), ), ), Expanded( diff --git a/dev/integration_tests/hybrid_android_views/lib/nested_view_event_page.dart b/dev/integration_tests/hybrid_android_views/lib/nested_view_event_page.dart index 13d3c4670a..b9583b0735 100644 --- a/dev/integration_tests/hybrid_android_views/lib/nested_view_event_page.dart +++ b/dev/integration_tests/hybrid_android_views/lib/nested_view_event_page.dart @@ -61,25 +61,25 @@ class NestedViewEventBodyState extends State { if (viewChannel != null) ... [ ElevatedButton( key: const ValueKey('ShowAlertDialog'), - child: const Text('SHOW ALERT DIALOG'), onPressed: onShowAlertDialogPressed, + child: const Text('SHOW ALERT DIALOG'), ), ElevatedButton( key: const ValueKey('TogglePlatformView'), - child: const Text('TOGGLE PLATFORM VIEW'), onPressed: onTogglePlatformView, + child: const Text('TOGGLE PLATFORM VIEW'), ), Row( children: [ ElevatedButton( key: const ValueKey('AddChildView'), - child: const Text('ADD CHILD VIEW'), onPressed: onChildViewPressed, + child: const Text('ADD CHILD VIEW'), ), ElevatedButton( key: const ValueKey('TapChildView'), - child: const Text('TAP CHILD VIEW'), onPressed: onTapChildViewPressed, + child: const Text('TAP CHILD VIEW'), ), if (nestedViewClickCount > 0) Text( diff --git a/dev/integration_tests/ios_platform_view_tests/lib/main.dart b/dev/integration_tests/ios_platform_view_tests/lib/main.dart index f83212f9a6..55ceca0c68 100644 --- a/dev/integration_tests/ios_platform_view_tests/lib/main.dart +++ b/dev/integration_tests/ios_platform_view_tests/lib/main.dart @@ -83,8 +83,8 @@ class PlatformViewPage extends StatelessWidget { children: [ const Expanded( child: SizedBox( - child: UiKitView(viewType: 'platform_view'), width: 300, + child: UiKitView(viewType: 'platform_view'), ), ), ElevatedButton( diff --git a/dev/manual_tests/lib/actions.dart b/dev/manual_tests/lib/actions.dart index 7a546787d8..997aa7e666 100644 --- a/dev/manual_tests/lib/actions.dart +++ b/dev/manual_tests/lib/actions.dart @@ -455,23 +455,23 @@ class _FocusDemoState extends State { Padding( padding: const EdgeInsets.all(8.0), child: ElevatedButton( - child: const Text('UNDO'), onPressed: canUndo ? () { Actions.invoke(context, const UndoIntent()); } : null, + child: const Text('UNDO'), ), ), Padding( padding: const EdgeInsets.all(8.0), child: ElevatedButton( - child: const Text('REDO'), onPressed: canRedo ? () { Actions.invoke(context, const RedoIntent()); } : null, + child: const Text('REDO'), ), ), ], diff --git a/dev/manual_tests/lib/card_collection.dart b/dev/manual_tests/lib/card_collection.dart index 5eebeeaab5..a026fa5426 100644 --- a/dev/manual_tests/lib/card_collection.dart +++ b/dev/manual_tests/lib/card_collection.dart @@ -366,7 +366,7 @@ class CardCollectionState extends State { cardCollection = Stack( children: [ Column(children: [Image.network(_sunshineURL)]), - ShaderMask(child: cardCollection, shaderCallback: _createShader), + ShaderMask(shaderCallback: _createShader, child: cardCollection), ], ); } diff --git a/dev/manual_tests/lib/density.dart b/dev/manual_tests/lib/density.dart index 9b98513f31..1171ac9afe 100644 --- a/dev/manual_tests/lib/density.dart +++ b/dev/manual_tests/lib/density.dart @@ -309,12 +309,12 @@ class _OptionsState extends State { }, items: const >[ DropdownMenuItem( - child: Text('Standard'), value: 'standard', + child: Text('Standard'), ), - DropdownMenuItem(child: Text('Comfortable'), value: 'comfortable'), - DropdownMenuItem(child: Text('Compact'), value: 'compact'), - DropdownMenuItem(child: Text('Custom'), value: 'custom'), + DropdownMenuItem(value: 'comfortable', child: Text('Comfortable')), + DropdownMenuItem(value: 'compact', child: Text('Compact')), + DropdownMenuItem(value: 'custom', child: Text('Custom')), ], value: _densityToProfile(widget.model.density), ), diff --git a/dev/manual_tests/lib/hover.dart b/dev/manual_tests/lib/hover.dart index ba852320fd..b040b8c0ea 100644 --- a/dev/manual_tests/lib/hover.dart +++ b/dev/manual_tests/lib/hover.dart @@ -65,13 +65,13 @@ class _HoverDemoState extends State { children: [ ElevatedButton( onPressed: () => print('Button pressed.'), - child: const Text('Button'), style: overrideFocusColor, + child: const Text('Button'), ), TextButton( onPressed: () => print('Button pressed.'), - child: const Text('Button'), style: overrideFocusColor, + child: const Text('Button'), ), IconButton( onPressed: () => print('Button pressed'), diff --git a/dev/manual_tests/lib/page_view.dart b/dev/manual_tests/lib/page_view.dart index af37a4e645..f6c1a91767 100644 --- a/dev/manual_tests/lib/page_view.dart +++ b/dev/manual_tests/lib/page_view.dart @@ -121,9 +121,9 @@ class PageViewAppState extends State { Widget _buildBody(BuildContext context) { return PageView( - children: cardModels.map(buildCard).toList(), // TODO(abarth): itemsWrap: itemsWrap, scrollDirection: scrollDirection, + children: cardModels.map(buildCard).toList(), ); } diff --git a/examples/layers/services/isolate.dart b/examples/layers/services/isolate.dart index 52285351ce..255d098067 100644 --- a/examples/layers/services/isolate.dart +++ b/examples/layers/services/isolate.dart @@ -255,8 +255,8 @@ class IsolateExampleState extends State with SingleTickerProvide Text(_status), Center( child: ElevatedButton( - child: Text(_label), onPressed: _handleButtonPressed, + child: Text(_label), ), ), Text(_result), diff --git a/examples/layers/widgets/gestures.dart b/examples/layers/widgets/gestures.dart index 2c58dd7931..3b53cd4267 100644 --- a/examples/layers/widgets/gestures.dart +++ b/examples/layers/widgets/gestures.dart @@ -173,6 +173,7 @@ class GestureDemoState extends State { child: Container( padding: const EdgeInsets.all(4.0), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ @@ -211,7 +212,6 @@ class GestureDemoState extends State { ], ), ], - crossAxisAlignment: CrossAxisAlignment.start, ), ), ), diff --git a/examples/layers/widgets/sectors.dart b/examples/layers/widgets/sectors.dart index b98f7559e0..2ed2aae3a3 100644 --- a/examples/layers/widgets/sectors.dart +++ b/examples/layers/widgets/sectors.dart @@ -92,10 +92,12 @@ class SectorAppState extends State { Widget buildBody() { return Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 25.0), child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ ElevatedButton( onPressed: _enabledAdd ? addSector : null, @@ -128,7 +130,6 @@ class SectorAppState extends State { ), ), ], - mainAxisAlignment: MainAxisAlignment.spaceAround, ), ), Expanded( @@ -145,7 +146,6 @@ class SectorAppState extends State { ), ), ], - mainAxisAlignment: MainAxisAlignment.spaceBetween, ); } diff --git a/examples/layers/widgets/spinning_mixed.dart b/examples/layers/widgets/spinning_mixed.dart index fc893c7b13..b2f007f72f 100644 --- a/examples/layers/widgets/spinning_mixed.dart +++ b/examples/layers/widgets/spinning_mixed.dart @@ -41,6 +41,7 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) { child: SizedBox( height: 300.0, child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ const Rectangle(Color(0xFF00FFFF)), Material( @@ -48,6 +49,7 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) { padding: const EdgeInsets.all(10.0), margin: const EdgeInsets.all(10.0), child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ ElevatedButton( child: Row( @@ -63,13 +65,11 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) { ), CircularProgressIndicator(value: value), ], - mainAxisAlignment: MainAxisAlignment.spaceAround, ), ), ), const Rectangle(Color(0xFFFFFF00)), ], - mainAxisAlignment: MainAxisAlignment.spaceBetween, ), ), ), diff --git a/examples/platform_channel/lib/main.dart b/examples/platform_channel/lib/main.dart index c689cd822b..0b409d8778 100644 --- a/examples/platform_channel/lib/main.dart +++ b/examples/platform_channel/lib/main.dart @@ -68,8 +68,8 @@ class _PlatformChannelState extends State { Padding( padding: const EdgeInsets.all(16.0), child: ElevatedButton( - child: const Text('Refresh'), onPressed: _getBatteryLevel, + child: const Text('Refresh'), ), ), ], diff --git a/examples/platform_channel_swift/lib/main.dart b/examples/platform_channel_swift/lib/main.dart index c689cd822b..0b409d8778 100644 --- a/examples/platform_channel_swift/lib/main.dart +++ b/examples/platform_channel_swift/lib/main.dart @@ -68,8 +68,8 @@ class _PlatformChannelState extends State { Padding( padding: const EdgeInsets.all(16.0), child: ElevatedButton( - child: const Text('Refresh'), onPressed: _getBatteryLevel, + child: const Text('Refresh'), ), ), ], diff --git a/examples/platform_view/lib/main.dart b/examples/platform_view/lib/main.dart index 1351778727..f6cf4f0e39 100644 --- a/examples/platform_view/lib/main.dart +++ b/examples/platform_view/lib/main.dart @@ -75,10 +75,10 @@ class _MyHomePageState extends State { Padding( padding: const EdgeInsets.all(18.0), child: ElevatedButton( + onPressed: _launchPlatformCount, child: Platform.isIOS ? const Text('Continue in iOS view') : const Text('Continue in Android view'), - onPressed: _launchPlatformCount, ), ), ], diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart index 81913f25c2..2a998432f3 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -295,8 +295,8 @@ class _BottomSheetState extends State { onVerticalDragStart: _handleDragStart, onVerticalDragUpdate: _handleDragUpdate, onVerticalDragEnd: _handleDragEnd, - child: bottomSheet, excludeFromSemantics: true, + child: bottomSheet, ); } } diff --git a/packages/flutter/test/material/bottom_app_bar_test.dart b/packages/flutter/test/material/bottom_app_bar_test.dart index c65b99a40a..ec03397474 100644 --- a/packages/flutter/test/material/bottom_app_bar_test.dart +++ b/packages/flutter/test/material/bottom_app_bar_test.dart @@ -225,9 +225,9 @@ void main() { home: Scaffold( bottomNavigationBar: ShapeListener( BottomAppBar( - child: SizedBox(height: 100.0), shape: RectangularNotch(), notchMargin: 0.0, + child: SizedBox(height: 100.0), ), ), floatingActionButton: FloatingActionButton( @@ -277,9 +277,9 @@ void main() { home: Scaffold( bottomNavigationBar: ShapeListener( BottomAppBar( - child: SizedBox(height: 100.0), shape: RectangularNotch(), notchMargin: 6.0, + child: SizedBox(height: 100.0), ), ), floatingActionButton: FloatingActionButton( @@ -353,9 +353,9 @@ void main() { home: Scaffold( bottomNavigationBar: BottomAppBar( - child: SizedBox(height: 100.0), shape: RectangularNotch(), notchMargin: 0.0, + child: SizedBox(height: 100.0), ), ), ), @@ -369,10 +369,10 @@ void main() { home: Scaffold( bottomNavigationBar: BottomAppBar( - child: SizedBox(height: 100.0), shape: RectangularNotch(), notchMargin: 0.0, clipBehavior: Clip.antiAliasWithSaveLayer, + child: SizedBox(height: 100.0), ), ), ), @@ -467,8 +467,8 @@ class ShapeListenerState extends State { @override Widget build(BuildContext context) { return CustomPaint( - child: widget.child, painter: cache, + child: widget.child, ); } diff --git a/packages/flutter/test/material/bottom_sheet_test.dart b/packages/flutter/test/material/bottom_sheet_test.dart index 05845093e3..ac465ca564 100644 --- a/packages/flutter/test/material/bottom_sheet_test.dart +++ b/packages/flutter/test/material/bottom_sheet_test.dart @@ -791,9 +791,9 @@ void main() { ), builder: (BuildContext context) { return MaterialButton( - child: const Text('BottomSheet'), onPressed: () => Navigator.pop(context), key: tapTargetToClose, + child: const Text('BottomSheet'), ); }, ); diff --git a/packages/flutter/test/material/button_theme_test.dart b/packages/flutter/test/material/button_theme_test.dart index 0bb9d0b9ae..0ff40626cb 100644 --- a/packages/flutter/test/material/button_theme_test.dart +++ b/packages/flutter/test/material/button_theme_test.dart @@ -361,9 +361,9 @@ void main() { ), textTheme: ButtonTextTheme.primary, child: FlatButton( - child: const Text('FlatButton'), onPressed: () {}, focusNode: focusNode, + child: const Text('FlatButton'), ), ), ), diff --git a/packages/flutter/test/material/dialog_test.dart b/packages/flutter/test/material/dialog_test.dart index aba21dcf53..6096750539 100644 --- a/packages/flutter/test/material/dialog_test.dart +++ b/packages/flutter/test/material/dialog_test.dart @@ -180,8 +180,8 @@ void main() { testWidgets('SimpleDialog custom clipBehavior', (WidgetTester tester) async { const SimpleDialog dialog = SimpleDialog( - children: [], clipBehavior: Clip.antiAlias, + children: [], ); await tester.pumpWidget(_buildAppWithDialog(dialog)); @@ -327,8 +327,8 @@ void main() { children: [ SimpleDialogOption( onPressed: () {}, - child: const Text('First option'), padding: customPadding, + child: const Text('First option'), ), ], ); @@ -1263,8 +1263,8 @@ void main() { viewInsets: EdgeInsets.zero, ), child: Dialog( - child: Placeholder(), insetPadding: null, + child: Placeholder(), ), ), ); diff --git a/packages/flutter/test/material/dropdown_form_field_test.dart b/packages/flutter/test/material/dropdown_form_field_test.dart index 66883d6d73..43c84d35d6 100644 --- a/packages/flutter/test/material/dropdown_form_field_test.dart +++ b/packages/flutter/test/material/dropdown_form_field_test.dart @@ -650,8 +650,8 @@ void main() { }, items: items.map((String string) { return DropdownMenuItem( - child: Text(string), value: string, + child: Text(string), ); }).toList(), ), diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index e50291870d..22e1b788c2 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -604,12 +604,12 @@ void main() { value: 1, items: const >[ DropdownMenuItem( - child: Text('First Item'), value: 1, + child: Text('First Item'), ), DropdownMenuItem( - child: Text('Second Item'), value: 2, + child: Text('Second Item'), ), ], onChanged: (_) { }, @@ -1512,12 +1512,12 @@ void main() { hint: hint, items: const >[ DropdownMenuItem( - child: Text('one'), value: 'one', + child: Text('one'), ), DropdownMenuItem( - child: Text('two'), value: 'two', + child: Text('two'), ), ], value: value, @@ -2107,8 +2107,8 @@ void main() { }, items: items.map((String string) { return DropdownMenuItem( - child: Text(string), value: string, + child: Text(string), ); }).toList(), ), @@ -2163,8 +2163,8 @@ void main() { }, items: items.map((String item) { return DropdownMenuItem( - child: Text(item), value: item, + child: Text(item), ); }).toList(), ), @@ -2523,8 +2523,8 @@ void main() { }, items: items.map((MapEntry item) { return DropdownMenuItem( - child: Text(item.value), value: item.key, + child: Text(item.value), ); }).toList(), ), diff --git a/packages/flutter/test/material/elevated_button_test.dart b/packages/flutter/test/material/elevated_button_test.dart index a22b7f5332..436d2743b5 100644 --- a/packages/flutter/test/material/elevated_button_test.dart +++ b/packages/flutter/test/material/elevated_button_test.dart @@ -154,9 +154,9 @@ void main() { home: Scaffold( body: Center( child: ElevatedButton( - child: const Text('ElevatedButton'), onPressed: () { }, focusNode: focusNode, + child: const Text('ElevatedButton'), ), ), ), @@ -221,9 +221,9 @@ void main() { child: Builder( builder: (BuildContext context) { return ElevatedButton( - child: const Text('ElevatedButton'), onPressed: () {}, focusNode: focusNode, + child: const Text('ElevatedButton'), ); }, ), @@ -348,9 +348,9 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: ElevatedButton( - child: const Text('button'), onPressed: onPressed, onLongPress: onLongPress, + child: const Text('button'), ), ); } diff --git a/packages/flutter/test/material/flat_button_test.dart b/packages/flutter/test/material/flat_button_test.dart index 040d6f42d7..c2739ab71b 100644 --- a/packages/flutter/test/material/flat_button_test.dart +++ b/packages/flutter/test/material/flat_button_test.dart @@ -119,9 +119,9 @@ void main() { home: Scaffold( body: Center( child: FlatButton( - child: const Text('FlatButton'), onPressed: () { }, focusNode: focusNode, + child: const Text('FlatButton'), ), ), ), @@ -182,10 +182,10 @@ void main() { colorScheme: colorScheme, textTheme: ButtonTextTheme.primary, child: FlatButton( - child: const Text('FlatButton'), onPressed: () {}, focusNode: focusNode, textColor: MaterialStateColor.resolveWith(getTextColor), + child: const Text('FlatButton'), ), ), ), @@ -248,10 +248,10 @@ void main() { home: Scaffold( body: Center( child: FlatButton( - child: const Text('FlatButton'), onPressed: () {}, focusNode: focusNode, textColor: MaterialStateColor.resolveWith(getTextColor), + child: const Text('FlatButton'), ), ), ), @@ -374,10 +374,10 @@ void main() { body: Center( child: FlatButton( onPressed: null, - child: const Text('FlatButton'), focusNode: focusNode, textColor: MaterialStateColor.resolveWith(getTextColor), disabledTextColor: unusedDisabledTextColor, + child: const Text('FlatButton'), ), ), ), @@ -697,9 +697,9 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: FlatButton( - child: const Text('button'), onPressed: onPressed, onLongPress: onLongPress, + child: const Text('button'), ), ); } diff --git a/packages/flutter/test/material/floating_action_button_location_test.dart b/packages/flutter/test/material/floating_action_button_location_test.dart index 01a14b6ccd..69ae6dee06 100644 --- a/packages/flutter/test/material/floating_action_button_location_test.dart +++ b/packages/flutter/test/material/floating_action_button_location_test.dart @@ -652,9 +652,9 @@ void main() { const SnackBar(content: Text('Snacky!')), ); }, - child: const Text('FAB'), mini: mini, key: key, + child: const Text('FAB'), ); }, ), @@ -1593,8 +1593,8 @@ Widget _singleFabScaffold( ), floatingActionButton: FloatingActionButton( onPressed: () {}, - child: const Icon(Icons.beach_access), mini: mini, + child: const Icon(Icons.beach_access), ), floatingActionButtonLocation: location, floatingActionButtonAnimator: animator, diff --git a/packages/flutter/test/material/floating_action_button_theme_test.dart b/packages/flutter/test/material/floating_action_button_theme_test.dart index 8dc5172c80..19ba041d39 100644 --- a/packages/flutter/test/material/floating_action_button_theme_test.dart +++ b/packages/flutter/test/material/floating_action_button_theme_test.dart @@ -96,7 +96,6 @@ void main() { home: Scaffold( floatingActionButton: FloatingActionButton( onPressed: () { }, - child: const Icon(Icons.add), backgroundColor: backgroundColor, foregroundColor: foregroundColor, splashColor: splashColor, @@ -104,6 +103,7 @@ void main() { disabledElevation: disabledElevation, highlightElevation: highlightElevation, shape: shape, + child: const Icon(Icons.add), ), ), )); diff --git a/packages/flutter/test/material/inherited_theme_test.dart b/packages/flutter/test/material/inherited_theme_test.dart index f83918a378..9c05d62a69 100644 --- a/packages/flutter/test/material/inherited_theme_test.dart +++ b/packages/flutter/test/material/inherited_theme_test.dart @@ -530,11 +530,11 @@ void main() { final Widget toggleButtons = Scaffold( body: Center( child: ToggleButtons( + isSelected: const [true, false], children: const [ Text('selected'), Text('unselected'), ], - isSelected: const [true, false], onPressed: (int index) { }, ), ), @@ -622,7 +622,7 @@ void main() { child: Column( mainAxisSize: MainAxisSize.min, children: [ - const RaisedButton(child: Text('disabled'), onPressed: null), + const RaisedButton(onPressed: null, child: Text('disabled')), RaisedButton(child: const Text('enabled'), onPressed: () { }), ], ), diff --git a/packages/flutter/test/material/ink_well_test.dart b/packages/flutter/test/material/ink_well_test.dart index f5a9cb0883..7dbf405d16 100644 --- a/packages/flutter/test/material/ink_well_test.dart +++ b/packages/flutter/test/material/ink_well_test.dart @@ -624,8 +624,8 @@ void main() { child: Material( child: InkWell( onTap: () { }, - child: const Text('Button'), excludeFromSemantics: true, + child: const Text('Button'), ), ), )); diff --git a/packages/flutter/test/material/material_button_test.dart b/packages/flutter/test/material/material_button_test.dart index ebd769afb1..46f2ef797f 100644 --- a/packages/flutter/test/material/material_button_test.dart +++ b/packages/flutter/test/material/material_button_test.dart @@ -307,9 +307,9 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: MaterialButton( - child: const Text('button'), onPressed: onPressed, onLongPress: onLongPress, + child: const Text('button'), ), ); } @@ -622,8 +622,8 @@ void main() { child: Material( child: Center( child: MaterialButton( - child: Text('Button'), onPressed: null, // button is disabled + child: Text('Button'), ), ), ), diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart index 79e610d955..df7ae5d788 100644 --- a/packages/flutter/test/material/material_test.dart +++ b/packages/flutter/test/material/material_test.dart @@ -426,8 +426,8 @@ void main() { Material( key: materialKey, type: MaterialType.transparency, - child: const SizedBox(width: 100.0, height: 100.0), clipBehavior: Clip.antiAlias, + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -441,8 +441,8 @@ void main() { key: materialKey, type: MaterialType.transparency, borderRadius: const BorderRadius.all(Radius.circular(10.0)), - child: const SizedBox(width: 100.0, height: 100.0), clipBehavior: Clip.antiAlias, + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -461,8 +461,8 @@ void main() { key: materialKey, type: MaterialType.transparency, shape: const StadiumBorder(), - child: const SizedBox(width: 100.0, height: 100.0), clipBehavior: Clip.antiAlias, + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -481,8 +481,8 @@ void main() { return Material( type: MaterialType.transparency, shape: shape, - child: const SizedBox(width: 100.0, height: 100.0), clipBehavior: Clip.antiAlias, + child: const SizedBox(width: 100.0, height: 100.0), ); } final Widget material = buildMaterial(); @@ -563,8 +563,8 @@ void main() { key: materialKey, type: MaterialType.canvas, borderRadius: const BorderRadius.all(Radius.circular(5.0)), - child: const SizedBox(width: 100.0, height: 100.0), elevation: 1.0, + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -582,8 +582,8 @@ void main() { key: materialKey, type: MaterialType.canvas, shape: const StadiumBorder(), - child: const SizedBox(width: 100.0, height: 100.0), elevation: 1.0, + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -653,8 +653,8 @@ void main() { Material( key: materialKey, type: MaterialType.circle, - child: const SizedBox(width: 100.0, height: 100.0), color: const Color(0xFF0000FF), + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -670,8 +670,8 @@ void main() { Material( key: materialKey, type: MaterialType.button, - child: const SizedBox(width: 100.0, height: 100.0), color: const Color(0xFF0000FF), + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -688,10 +688,10 @@ void main() { Material( key: materialKey, type: MaterialType.button, - child: const SizedBox(width: 100.0, height: 100.0), color: const Color(0xFF0000FF), borderRadius: const BorderRadius.all(Radius.circular(6.0)), elevation: 4.0, + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -708,10 +708,10 @@ void main() { Material( key: materialKey, type: MaterialType.button, - child: const SizedBox(width: 100.0, height: 100.0), color: const Color(0xFF0000FF), shape: const StadiumBorder(), elevation: 4.0, + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -729,7 +729,6 @@ void main() { Material( key: materialKey, type: MaterialType.button, - child: const SizedBox(width: 100.0, height: 100.0), color: const Color(0xFF0000FF), shape: const CircleBorder( side: BorderSide( @@ -737,6 +736,7 @@ void main() { color: Color(0xFF0000FF), ), ), + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -750,13 +750,13 @@ void main() { Material( key: materialKey, type: MaterialType.transparency, - child: const SizedBox(width: 100.0, height: 100.0), shape: const CircleBorder( side: BorderSide( width: 2.0, color: Color(0xFF0000FF), ), ), + child: const SizedBox(width: 100.0, height: 100.0), ), ); @@ -770,8 +770,8 @@ void main() { Material( key: materialKey, type: MaterialType.transparency, - child: const SizedBox(width: 100.0, height: 100.0), shape: const CircleBorder(), + child: const SizedBox(width: 100.0, height: 100.0), ), ); diff --git a/packages/flutter/test/material/outline_button_test.dart b/packages/flutter/test/material/outline_button_test.dart index 1b59f0be46..434760bca2 100644 --- a/packages/flutter/test/material/outline_button_test.dart +++ b/packages/flutter/test/material/outline_button_test.dart @@ -259,9 +259,9 @@ void main() { home: Scaffold( body: Center( child: OutlineButton( - child: const Text('OutlineButton'), onPressed: () {}, focusNode: focusNode, + child: const Text('OutlineButton'), ), ), ), @@ -322,10 +322,10 @@ void main() { colorScheme: colorScheme, textTheme: ButtonTextTheme.primary, child: OutlineButton( - child: const Text('OutlineButton'), onPressed: () {}, focusNode: focusNode, textColor: MaterialStateColor.resolveWith(getTextColor), + child: const Text('OutlineButton'), ), ), ), @@ -388,10 +388,10 @@ void main() { home: Scaffold( body: Center( child: OutlineButton( - child: const Text('OutlineButton'), onPressed: () {}, focusNode: focusNode, textColor: MaterialStateColor.resolveWith(getTextColor), + child: const Text('OutlineButton'), ), ), ), @@ -514,10 +514,10 @@ void main() { body: Center( child: OutlineButton( onPressed: null, - child: const Text('OutlineButton'), focusNode: focusNode, textColor: MaterialStateColor.resolveWith(getTextColor), disabledTextColor: unusedDisabledTextColor, + child: const Text('OutlineButton'), ), ), ), @@ -559,10 +559,10 @@ void main() { home: Scaffold( body: Center( child: OutlineButton( - child: const Text('OutlineButton'), onPressed: () {}, focusNode: focusNode, borderSide: BorderSide(color: MaterialStateColor.resolveWith(getBorderColor)), + child: const Text('OutlineButton'), ), ), ), @@ -613,10 +613,10 @@ void main() { home: Scaffold( body: Center( child: OutlineButton( - child: const Text('OutlineButton'), onPressed: () {}, borderSide: BorderSide(color: MaterialStateColor.resolveWith(getBorderColor)), highlightedBorderColor: ignoredPressedColor, + child: const Text('OutlineButton'), ), ), ), @@ -651,10 +651,10 @@ void main() { home: Scaffold( body: Center( child: OutlineButton( - child: const Text('OutlineButton'), onPressed: null, borderSide: BorderSide(color: MaterialStateColor.resolveWith(getBorderColor)), highlightedBorderColor: ignoredDisabledColor, + child: const Text('OutlineButton'), ), ), ), @@ -674,9 +674,9 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: OutlineButton( - child: const Text('button'), onPressed: onPressed, onLongPress: onLongPress, + child: const Text('button'), ), ); } diff --git a/packages/flutter/test/material/outlined_button_test.dart b/packages/flutter/test/material/outlined_button_test.dart index 397a61e5fe..b1e21aa058 100644 --- a/packages/flutter/test/material/outlined_button_test.dart +++ b/packages/flutter/test/material/outlined_button_test.dart @@ -259,9 +259,9 @@ void main() { home: Scaffold( body: Center( child: OutlinedButton( - child: const Text('OutlinedButton'), onPressed: () {}, focusNode: focusNode, + child: const Text('OutlinedButton'), ), ), ), @@ -327,9 +327,9 @@ void main() { child: Builder( builder: (BuildContext context) { return OutlinedButton( - child: const Text('OutlinedButton'), onPressed: () {}, focusNode: focusNode, + child: const Text('OutlinedButton'), ); }, ), @@ -578,9 +578,9 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: OutlinedButton( - child: const Text('button'), onPressed: onPressed, onLongPress: onLongPress, + child: const Text('button'), ), ); } diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index 4044871b64..04560345cf 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -147,8 +147,8 @@ void main() { child: Column( children: [ PopupMenuButton( - child: Text('Tap Me', key: popupButtonKey), enabled: false, + child: Text('Tap Me', key: popupButtonKey), itemBuilder: (BuildContext context) { itemBuilderCalled = true; return >[ @@ -222,8 +222,8 @@ void main() { children: [ PopupMenuButton( key: popupButtonKey, - child: Container(key: childKey), enabled: false, + child: Container(key: childKey), itemBuilder: (BuildContext context) { itemBuilderCalled = true; return >[ @@ -264,8 +264,8 @@ void main() { children: [ PopupMenuButton( key: popupButtonKey, - child: Container(key: childKey), enabled: false, + child: Container(key: childKey), itemBuilder: (BuildContext context) { return >[ const PopupMenuItem( @@ -365,22 +365,22 @@ void main() { onSelected: (String value) { selected = value; }, itemBuilder: (BuildContext context) => >[ PopupMenuItem( - child: const Text('First option'), value: 'first', + child: const Text('First option'), onTap: () { menuItemTapCounters[0] += 1; }, ), PopupMenuItem( - child: const Text('Second option'), value: 'second', + child: const Text('Second option'), onTap: () { menuItemTapCounters[1] += 1; }, ), const PopupMenuItem( - child: Text('Option without onTap'), value: 'third', + child: Text('Option without onTap'), ), ], ), @@ -1289,17 +1289,17 @@ void main() { onSelected: (String result) { selectedValue = result; }, - child: const Text('Menu Button'), initialValue: '1', + child: const Text('Menu Button'), itemBuilder: (BuildContext context) => >[ const PopupMenuItem( - child: Text('1'), value: '1', + child: Text('1'), ), const PopupMenuDivider(), const PopupMenuItem( - child: Text('2'), value: '2', + child: Text('2'), ), ], ), @@ -2166,8 +2166,8 @@ void main() { ), ), itemBuilder: (BuildContext context) => >[ - const PopupMenuItem(child: Text('-1-'), value: 1), - const PopupMenuItem(child: Text('-2-'), value: 2), + const PopupMenuItem(value: 1, child: Text('-1-')), + const PopupMenuItem(value: 2, child: Text('-2-')), ], )], ), @@ -2364,8 +2364,8 @@ void main() { ), ), itemBuilder: (BuildContext context) => >[ - const PopupMenuItem(child: Text('-1-'), value: 1), - const PopupMenuItem(child: Text('-2-'), value: 2), + const PopupMenuItem(value: 1, child: Text('-1-')), + const PopupMenuItem(value: 2, child: Text('-2-')), ], ), const SizedBox(height: 600), diff --git a/packages/flutter/test/material/raised_button_test.dart b/packages/flutter/test/material/raised_button_test.dart index eab5648170..afd27e4d47 100644 --- a/packages/flutter/test/material/raised_button_test.dart +++ b/packages/flutter/test/material/raised_button_test.dart @@ -121,9 +121,9 @@ void main() { home: Scaffold( body: Center( child: RaisedButton( - child: const Text('RaisedButton'), onPressed: () { }, focusNode: focusNode, + child: const Text('RaisedButton'), ), ), ), @@ -185,10 +185,10 @@ void main() { home: Scaffold( body: Center( child: RaisedButton( - child: const Text('RaisedButton'), onPressed: () {}, focusNode: focusNode, textColor: MaterialStateColor.resolveWith(getTextColor), + child: const Text('RaisedButton'), ), ), ), @@ -312,10 +312,10 @@ void main() { body: Center( child: RaisedButton( onPressed: null, - child: const Text('RaisedButton'), focusNode: focusNode, textColor: MaterialStateColor.resolveWith(getTextColor), disabledTextColor: unusedDisabledTextColor, + child: const Text('RaisedButton'), ), ), ), @@ -340,9 +340,9 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: RaisedButton( - child: const Text('button'), onPressed: onPressed, onLongPress: onLongPress, + child: const Text('button'), ), ); } diff --git a/packages/flutter/test/material/raw_material_button_test.dart b/packages/flutter/test/material/raw_material_button_test.dart index 59706987de..5b7660a4f6 100644 --- a/packages/flutter/test/material/raw_material_button_test.dart +++ b/packages/flutter/test/material/raw_material_button_test.dart @@ -447,9 +447,9 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: RawMaterialButton( - child: const Text('button'), onPressed: onPressed, onLongPress: onLongPress, + child: const Text('button'), ), ); } diff --git a/packages/flutter/test/material/reorderable_list_test.dart b/packages/flutter/test/material/reorderable_list_test.dart index 133f52e348..45b9ce1024 100644 --- a/packages/flutter/test/material/reorderable_list_test.dart +++ b/packages/flutter/test/material/reorderable_list_test.dart @@ -47,11 +47,11 @@ void main() { width: itemHeight * 10, child: ReorderableListView( header: header, - children: listItems.map(listItemToWidget).toList(), scrollDirection: scrollDirection, onReorder: onReorder, reverse: reverse, padding: padding, + children: listItems.map(listItemToWidget).toList(), ), ), ), @@ -69,9 +69,9 @@ void main() { final List currentListItems = listItems.take(1).toList(); final ReorderableListView reorderableListView = ReorderableListView( header: const Text('Header'), - children: currentListItems.map(listItemToWidget).toList(), scrollDirection: Axis.vertical, onReorder: (_, __) => onReorderWasCalled = true, + children: currentListItems.map(listItemToWidget).toList(), ); final List currentOriginalListItems = originalListItems.take(1).toList(); await tester.pumpWidget(MaterialApp( @@ -156,6 +156,8 @@ void main() { testWidgets('properly determines the vertical drop area extents', (WidgetTester tester) async { final Widget reorderableListView = ReorderableListView( + scrollDirection: Axis.vertical, + onReorder: (int oldIndex, int newIndex) { }, children: const [ SizedBox( key: Key('Normal item'), @@ -173,8 +175,6 @@ void main() { child: Text('Last item'), ), ], - scrollDirection: Axis.vertical, - onReorder: (int oldIndex, int newIndex) { }, ); await tester.pumpWidget(MaterialApp( home: SizedBox( @@ -359,9 +359,9 @@ void main() { final ScrollController primary = ScrollController(); final Widget reorderableList = ReorderableListView( children: const [ - SizedBox(width: 100.0, height: 100.0, child: Text('C'), key: Key('C')), - SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: Key('B')), - SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: Key('A')), + SizedBox(width: 100.0, height: 100.0, key: Key('C'), child: Text('C')), + SizedBox(width: 100.0, height: 100.0, key: Key('B'), child: Text('B')), + SizedBox(width: 100.0, height: 100.0, key: Key('A'), child: Text('A')), ], onReorder: (int oldIndex, int newIndex) { }, ); @@ -408,9 +408,9 @@ void main() { scrollController: customController, onReorder: (int oldIndex, int newIndex) { }, children: const [ - SizedBox(width: 100.0, height: 100.0, child: Text('C'), key: firstBox), - SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: secondBox), - SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: thirdBox), + SizedBox(width: 100.0, height: 100.0, key: firstBox, child: Text('C')), + SizedBox(width: 100.0, height: 100.0, key: secondBox, child: Text('B')), + SizedBox(width: 100.0, height: 100.0, key: thirdBox, child: Text('A')), ], ), ), @@ -459,9 +459,9 @@ void main() { testWidgets('Still builds when no PrimaryScrollController is available', (WidgetTester tester) async { final Widget reorderableList = ReorderableListView( children: const [ - SizedBox(width: 100.0, height: 100.0, child: Text('C'), key: Key('C')), - SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: Key('B')), - SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: Key('A')), + SizedBox(width: 100.0, height: 100.0, key: Key('C'), child: Text('C')), + SizedBox(width: 100.0, height: 100.0, key: Key('B'), child: Text('B')), + SizedBox(width: 100.0, height: 100.0, key: Key('A'), child: Text('A')), ], onReorder: (int oldIndex, int newIndex) { }, ); @@ -621,6 +621,8 @@ void main() { testWidgets("Doesn't hide accessibility when a child declares its own semantics", (WidgetTester tester) async { final SemanticsHandle handle = tester.ensureSemantics(); final Widget reorderableListView = ReorderableListView( + scrollDirection: Axis.vertical, + onReorder: (int oldIndex, int newIndex) { }, children: [ const SizedBox( key: Key('List tile 1'), @@ -644,8 +646,6 @@ void main() { child: Text('List tile 2'), ), ], - scrollDirection: Axis.vertical, - onReorder: (int oldIndex, int newIndex) { }, ); await tester.pumpWidget(MaterialApp( home: SizedBox( @@ -684,9 +684,9 @@ void main() { final List currentListItems = listItems.take(1).toList(); final ReorderableListView reorderableListView = ReorderableListView( header: const Text('Header'), - children: currentListItems.map(listItemToWidget).toList(), scrollDirection: Axis.horizontal, onReorder: (_, __) => onReorderWasCalled = true, + children: currentListItems.map(listItemToWidget).toList(), ); final List currentOriginalListItems = originalListItems.take(1).toList(); await tester.pumpWidget(MaterialApp( @@ -767,6 +767,8 @@ void main() { testWidgets('properly determines the horizontal drop area extents', (WidgetTester tester) async { final Widget reorderableListView = ReorderableListView( + scrollDirection: Axis.horizontal, + onReorder: (int oldIndex, int newIndex) { }, children: const [ SizedBox( key: Key('Normal item'), @@ -784,8 +786,6 @@ void main() { child: Text('Last item'), ), ], - scrollDirection: Axis.horizontal, - onReorder: (int oldIndex, int newIndex) { }, ); await tester.pumpWidget(MaterialApp( home: SizedBox( @@ -836,6 +836,8 @@ void main() { testWidgets('Horizontal drag in progress golden image', (WidgetTester tester) async { debugDisableShadows = false; final Widget reorderableListView = ReorderableListView( + scrollDirection: Axis.horizontal, + onReorder: (int oldIndex, int newIndex) { }, children: [ Container( key: const Key('pink'), @@ -856,8 +858,6 @@ void main() { color: Colors.green, ), ], - scrollDirection: Axis.horizontal, - onReorder: (int oldIndex, int newIndex) { }, ); await tester.pumpWidget(MaterialApp( home: Container( @@ -907,13 +907,13 @@ void main() { } await tester.pumpWidget(MaterialApp( home: ReorderableListView( + onReorder: (int oldIndex, int newIndex) { }, + scrollDirection: Axis.horizontal, children: [ _Stateful(key: const Key('A')), _Stateful(key: const Key('B')), _Stateful(key: const Key('C')), ], - onReorder: (int oldIndex, int newIndex) { }, - scrollDirection: Axis.horizontal, ), )); await tester.tap(find.byKey(const Key('A'))); @@ -925,13 +925,13 @@ void main() { await tester.pumpWidget(MaterialApp( home: ReorderableListView( + onReorder: (int oldIndex, int newIndex) { }, + scrollDirection: Axis.horizontal, children: [ _Stateful(key: const Key('B')), _Stateful(key: const Key('C')), _Stateful(key: const Key('A')), ], - onReorder: (int oldIndex, int newIndex) { }, - scrollDirection: Axis.horizontal, ), )); // Only the 'A' widget should be checked. @@ -1291,6 +1291,8 @@ void main() { testWidgets('ReorderableListView can be reversed', (WidgetTester tester) async { final Widget reorderableListView = ReorderableListView( + reverse: true, + onReorder: (int oldIndex, int newIndex) { }, children: const [ SizedBox( key: Key('A'), @@ -1305,8 +1307,6 @@ void main() { child: Text('C'), ), ], - reverse: true, - onReorder: (int oldIndex, int newIndex) { }, ); await tester.pumpWidget(MaterialApp( home: reorderableListView, @@ -1317,6 +1317,8 @@ void main() { testWidgets('Animation test when placing an item in place', (WidgetTester tester) async { const Key testItemKey = Key('Test item'); final Widget reorderableListView = ReorderableListView( + scrollDirection: Axis.vertical, + onReorder: (int oldIndex, int newIndex) { }, children: const [ SizedBox( key: Key('First item'), @@ -1334,8 +1336,6 @@ void main() { child: Text('Last item'), ), ], - scrollDirection: Axis.vertical, - onReorder: (int oldIndex, int newIndex) { }, ); await tester.pumpWidget(MaterialApp( home: SizedBox( @@ -1411,13 +1411,13 @@ void main() { key: ValueKey(items[index]), height: 100, child: ReorderableDragStartListener( + index: index, child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('item ${items[index]}'), ], ), - index: index, ), ); }, @@ -1477,9 +1477,9 @@ void main() { testWidgets('Throws an error if no overlay present', (WidgetTester tester) async { final Widget reorderableList = ReorderableListView( children: const [ - SizedBox(width: 100.0, height: 100.0, child: Text('C'), key: Key('C')), - SizedBox(width: 100.0, height: 100.0, child: Text('B'), key: Key('B')), - SizedBox(width: 100.0, height: 100.0, child: Text('A'), key: Key('A')), + SizedBox(width: 100.0, height: 100.0, key: Key('C'), child: Text('C')), + SizedBox(width: 100.0, height: 100.0, key: Key('B'), child: Text('B')), + SizedBox(width: 100.0, height: 100.0, key: Key('A'), child: Text('A')), ], onReorder: (int oldIndex, int newIndex) { }, ); diff --git a/packages/flutter/test/material/text_button_test.dart b/packages/flutter/test/material/text_button_test.dart index ebd3f903d1..7600449849 100644 --- a/packages/flutter/test/material/text_button_test.dart +++ b/packages/flutter/test/material/text_button_test.dart @@ -149,9 +149,9 @@ void main() { home: Scaffold( body: Center( child: TextButton( - child: const Text('TextButton'), onPressed: () { }, focusNode: focusNode, + child: const Text('TextButton'), ), ), ), @@ -216,9 +216,9 @@ void main() { child: Builder( builder: (BuildContext context) { return TextButton( - child: const Text('TextButton'), onPressed: () {}, focusNode: focusNode, + child: const Text('TextButton'), ); }, ), @@ -631,9 +631,9 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: TextButton( - child: const Text('button'), onPressed: onPressed, onLongPress: onLongPress, + child: const Text('button'), ), ); } diff --git a/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart b/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart index 4ecdf51aee..e584366920 100644 --- a/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart +++ b/packages/flutter/test/material/text_selection_toolbar_text_button_test.dart @@ -21,8 +21,8 @@ void main() { builder: (BuildContext context, StateSetter setter) { setState = setter; return TextSelectionToolbarTextButton( - child: const Text('button'), padding: TextSelectionToolbarTextButton.getPadding(index, total), + child: const Text('button'), ); }, ), diff --git a/packages/flutter/test/material/tooltip_test.dart b/packages/flutter/test/material/tooltip_test.dart index 7f37413da0..09f2df38e1 100644 --- a/packages/flutter/test/material/tooltip_test.dart +++ b/packages/flutter/test/material/tooltip_test.dart @@ -1159,8 +1159,8 @@ void main() { home: Center( child: Tooltip( message: 'Foo', - child: Text('Bar'), excludeFromSemantics: true, + child: Text('Bar'), ), ), ), diff --git a/packages/flutter/test/widgets/align_test.dart b/packages/flutter/test/widgets/align_test.dart index 27cc681237..9e5464aeac 100644 --- a/packages/flutter/test/widgets/align_test.dart +++ b/packages/flutter/test/widgets/align_test.dart @@ -9,15 +9,15 @@ void main() { testWidgets('Align smoke test', (WidgetTester tester) async { await tester.pumpWidget( Align( - child: Container(), alignment: const Alignment(0.50, 0.50), + child: Container(), ), ); await tester.pumpWidget( Align( - child: Container(), alignment: Alignment.center, + child: Container(), ), ); @@ -43,8 +43,8 @@ void main() { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: Align( - child: SizedBox(width: 100.0, height: 80.0), alignment: AlignmentDirectional.topStart, + child: SizedBox(width: 100.0, height: 80.0), ), )); @@ -54,8 +54,8 @@ void main() { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: Align( - child: SizedBox(width: 100.0, height: 80.0), alignment: Alignment.topLeft, + child: SizedBox(width: 100.0, height: 80.0), ), )); @@ -67,8 +67,8 @@ void main() { await tester.pumpWidget(const Directionality( textDirection: TextDirection.rtl, child: Align( - child: SizedBox(width: 100.0, height: 80.0), alignment: AlignmentDirectional.topStart, + child: SizedBox(width: 100.0, height: 80.0), ), )); @@ -78,8 +78,8 @@ void main() { await tester.pumpWidget(const Directionality( textDirection: TextDirection.ltr, child: Align( - child: SizedBox(width: 100.0, height: 80.0), alignment: Alignment.topLeft, + child: SizedBox(width: 100.0, height: 80.0), ), )); @@ -93,11 +93,11 @@ void main() { SingleChildScrollView( child: Align( key: alignKey, + alignment: Alignment.center, child: const SizedBox( width: 10.0, height: 10.0, ), - alignment: Alignment.center, ), ), ); diff --git a/packages/flutter/test/widgets/animated_container_test.dart b/packages/flutter/test/widgets/animated_container_test.dart index 10d2b28590..476df620e5 100644 --- a/packages/flutter/test/widgets/animated_container_test.dart +++ b/packages/flutter/test/widgets/animated_container_test.dart @@ -294,9 +294,9 @@ void main() { textDirection: TextDirection.ltr, child: AnimatedContainer( duration: const Duration(milliseconds: 200), - child: SizedBox(key: target, width: 100.0, height: 200.0), transform: Matrix4.diagonal3Values(0.5, 0.5, 1), transformAlignment: Alignment.topLeft, + child: SizedBox(key: target, width: 100.0, height: 200.0), ), ), ), @@ -311,9 +311,9 @@ void main() { textDirection: TextDirection.ltr, child: AnimatedContainer( duration: const Duration(milliseconds: 200), - child: SizedBox(key: target, width: 100.0, height: 200.0), transform: Matrix4.diagonal3Values(0.5, 0.5, 1), transformAlignment: Alignment.bottomRight, + child: SizedBox(key: target, width: 100.0, height: 200.0), ), ), ), diff --git a/packages/flutter/test/widgets/animated_positioned_test.dart b/packages/flutter/test/widgets/animated_positioned_test.dart index b117585dbb..f1a794069a 100644 --- a/packages/flutter/test/widgets/animated_positioned_test.dart +++ b/packages/flutter/test/widgets/animated_positioned_test.dart @@ -30,12 +30,12 @@ void main() { textDirection: TextDirection.ltr, children: [ AnimatedPositioned( - child: Container(key: key), left: 50.0, top: 30.0, width: 70.0, height: 110.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -54,12 +54,12 @@ void main() { textDirection: TextDirection.ltr, children: [ AnimatedPositioned( - child: Container(key: key), left: 37.0, top: 31.0, width: 59.0, height: 71.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -113,12 +113,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 50.0, top: 30.0, width: 70.0, height: 110.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -139,12 +139,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 37.0, top: 31.0, width: 59.0, height: 71.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -199,12 +199,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 50.0, top: 30.0, width: 70.0, height: 110.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -225,12 +225,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 37.0, top: 31.0, width: 59.0, height: 71.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -284,12 +284,12 @@ void main() { textDirection: TextDirection.ltr, children: [ AnimatedPositioned( - child: Container(key: key), left: 0.0, top: 0.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -308,12 +308,12 @@ void main() { textDirection: TextDirection.ltr, children: [ AnimatedPositioned( - child: Container(key: key), left: 100.0, top: 100.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -332,12 +332,12 @@ void main() { textDirection: TextDirection.ltr, children: [ AnimatedPositioned( - child: Container(key: key), left: 150.0, top: 150.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -367,12 +367,12 @@ void main() { textDirection: TextDirection.ltr, children: [ AnimatedPositioned( - child: Container(key: key), left: 0.0, top: 0.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -391,12 +391,12 @@ void main() { textDirection: TextDirection.ltr, children: [ AnimatedPositioned( - child: Container(key: key), left: 0.0, top: 100.0, right: 100.0, // 700.0 from the left height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -427,12 +427,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 0.0, top: 0.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -453,12 +453,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 100.0, top: 100.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -479,12 +479,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 150.0, top: 150.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -516,12 +516,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 0.0, top: 0.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -542,12 +542,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 0.0, top: 100.0, end: 100.0, // 700.0 from the start height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -579,12 +579,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 0.0, top: 0.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -605,12 +605,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 100.0, top: 100.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -631,12 +631,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 150.0, top: 150.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -668,12 +668,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 0.0, top: 0.0, width: 100.0, height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), @@ -694,12 +694,12 @@ void main() { child: Stack( children: [ AnimatedPositionedDirectional( - child: Container(key: key), start: 0.0, top: 100.0, end: 100.0, // 700.0 from the start height: 100.0, duration: const Duration(seconds: 2), + child: Container(key: key), ), ], ), diff --git a/packages/flutter/test/widgets/animated_switcher_test.dart b/packages/flutter/test/widgets/animated_switcher_test.dart index ff16785dfd..634782cf3f 100644 --- a/packages/flutter/test/widgets/animated_switcher_test.dart +++ b/packages/flutter/test/widgets/animated_switcher_test.dart @@ -13,9 +13,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(key: containerOne, color: const Color(0x00000000)), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(key: containerOne, color: const Color(0x00000000)), ), ); @@ -26,9 +26,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(key: containerTwo, color: const Color(0xff000000)), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(key: containerTwo, color: const Color(0xff000000)), ), ); @@ -40,9 +40,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(key: containerThree, color: const Color(0xffff0000)), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(key: containerThree, color: const Color(0xffff0000)), ), ); @@ -63,9 +63,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(key: container1), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(key: container1), ), ); expect(find.byKey(container1), findsOneWidget); @@ -75,9 +75,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(key: container2), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(key: container2), ), ); expect(find.byKey(container1), findsOneWidget); @@ -87,9 +87,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(key: container3), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(key: container3), ), ); expect(find.byKey(container1), findsOneWidget); @@ -101,9 +101,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(color: const Color(0x00000000)), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(color: const Color(0x00000000)), ), ); @@ -114,9 +114,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(color: const Color(0xff000000)), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(color: const Color(0xff000000)), ), ); @@ -142,9 +142,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(color: const Color(0xff000000)), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(color: const Color(0xff000000)), ), ); @@ -156,9 +156,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(color: const Color(0x00000000)), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: Container(color: const Color(0x00000000)), ), ); @@ -198,8 +198,8 @@ void main() { testWidgets("AnimatedSwitcher doesn't start any animations after dispose.", (WidgetTester tester) async { await tester.pumpWidget(AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(color: const Color(0xff000000)), switchInCurve: Curves.linear, + child: Container(color: const Color(0xff000000)), )); await tester.pump(const Duration(milliseconds: 50)); @@ -221,9 +221,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(color: const Color(0x00000000)), switchInCurve: Curves.linear, layoutBuilder: newLayoutBuilder, + child: Container(color: const Color(0x00000000)), ), ); @@ -252,10 +252,10 @@ void main() { textDirection: TextDirection.rtl, child: AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(color: const Color(0x00000000)), switchInCurve: Curves.linear, layoutBuilder: newLayoutBuilder, transitionBuilder: newTransitionBuilder, + child: Container(color: const Color(0x00000000)), ), ), ); @@ -298,9 +298,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: StatefulTest(key: statefulOne), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: StatefulTest(key: statefulOne), ), ); @@ -312,9 +312,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: StatefulTest(key: statefulTwo), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: StatefulTest(key: statefulTwo), ), ); @@ -327,9 +327,9 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: StatefulTest(key: statefulThree), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: StatefulTest(key: statefulThree), ), ); @@ -352,9 +352,9 @@ void main() { textDirection: TextDirection.rtl, child: AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: child, switchInCurve: Curves.linear, switchOutCurve: Curves.linear, + child: child, ), ), ); @@ -392,10 +392,10 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), + switchInCurve: Curves.linear, + switchOutCurve: Curves.linear, + layoutBuilder: newLayoutBuilder, child: Container(key: containerOne, color: const Color(0xFFFF0000)), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, - layoutBuilder: newLayoutBuilder, ), ); @@ -404,10 +404,10 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), + switchInCurve: Curves.linear, + switchOutCurve: Curves.linear, + layoutBuilder: newLayoutBuilder, child: Container(key: containerTwo, color: const Color(0xFF00FF00)), - switchInCurve: Curves.linear, - switchOutCurve: Curves.linear, - layoutBuilder: newLayoutBuilder, ), ); @@ -416,10 +416,10 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(key: containerThree, color: const Color(0xFF0000FF)), switchInCurve: Curves.linear, switchOutCurve: Curves.linear, layoutBuilder: newLayoutBuilder, + child: Container(key: containerThree, color: const Color(0xFF0000FF)), ), ); @@ -446,10 +446,10 @@ void main() { await tester.pumpWidget( AnimatedSwitcher( duration: const Duration(milliseconds: 100), - child: Container(color: const Color(0x00000000)), switchInCurve: Curves.linear, layoutBuilder: newLayoutBuilder, transitionBuilder: newTransitionBuilder, + child: Container(color: const Color(0x00000000)), ), ); diff --git a/packages/flutter/test/widgets/annotated_region_test.dart b/packages/flutter/test/widgets/annotated_region_test.dart index d6cf140666..133949c1bb 100644 --- a/packages/flutter/test/widgets/annotated_region_test.dart +++ b/packages/flutter/test/widgets/annotated_region_test.dart @@ -12,8 +12,8 @@ void main() { testWidgets('provides a value to the layer tree', (WidgetTester tester) async { await tester.pumpWidget( const AnnotatedRegion( - child: SizedBox(width: 100.0, height: 100.0), value: 1, + child: SizedBox(width: 100.0, height: 100.0), ), ); final List layers = tester.layers; @@ -25,8 +25,8 @@ void main() { Transform.translate( offset: const Offset(25.0, 25.0), child: const AnnotatedRegion( - child: SizedBox(width: 100.0, height: 100.0), value: 1, + child: SizedBox(width: 100.0, height: 100.0), ), ), ); diff --git a/packages/flutter/test/widgets/clip_test.dart b/packages/flutter/test/widgets/clip_test.dart index a397b3566a..0d1f306d15 100644 --- a/packages/flutter/test/widgets/clip_test.dart +++ b/packages/flutter/test/widgets/clip_test.dart @@ -389,10 +389,10 @@ void main() { width: 100.0, height: 100.0, child: ClipRect( + clipBehavior: Clip.hardEdge, child: Container( color: Colors.blue, ), - clipBehavior: Clip.hardEdge, ), ), Positioned( @@ -835,8 +835,8 @@ void main() { await tester.pumpWidget( ClipRect( - child: const Placeholder(), clipper: NotifyClipper(clip: clip), + child: const Placeholder(), ), ); diff --git a/packages/flutter/test/widgets/custom_multi_child_layout_test.dart b/packages/flutter/test/widgets/custom_multi_child_layout_test.dart index fa6c365ea2..68b2b95f64 100644 --- a/packages/flutter/test/widgets/custom_multi_child_layout_test.dart +++ b/packages/flutter/test/widgets/custom_multi_child_layout_test.dart @@ -48,11 +48,11 @@ class TestMultiChildLayoutDelegate extends MultiChildLayoutDelegate { Widget buildFrame(MultiChildLayoutDelegate delegate) { return Center( child: CustomMultiChildLayout( + delegate: delegate, children: [ LayoutId(id: 0, child: const SizedBox(width: 150.0, height: 100.0)), LayoutId(id: 1, child: const SizedBox(width: 100.0, height: 200.0)), ], - delegate: delegate, ), ); } @@ -208,20 +208,20 @@ void main() { final TestMultiChildLayoutDelegate delegate = TestMultiChildLayoutDelegate(); await tester.pumpWidget(Center( child: CustomMultiChildLayout( + delegate: delegate, children: [ LayoutId( id: 0, child: CustomMultiChildLayout( + delegate: delegate, children: [ LayoutId(id: 0, child: const SizedBox(width: 150.0, height: 100.0)), LayoutId(id: 1, child: const SizedBox(width: 100.0, height: 200.0)), ], - delegate: delegate, ), ), LayoutId(id: 1, child: const SizedBox(width: 100.0, height: 200.0)), ], - delegate: delegate, ), )); @@ -276,8 +276,8 @@ void main() { Widget buildSingleChildFrame(MultiChildLayoutDelegate delegate) { return Center( child: CustomMultiChildLayout( - children: [LayoutId(id: 0, child: const SizedBox())], delegate: delegate, + children: [LayoutId(id: 0, child: const SizedBox())], ), ); } @@ -361,8 +361,8 @@ void main() { await expectFlutterErrorMessage( widget: Center( child: CustomMultiChildLayout( - children: [LayoutWithMissingId(child: Container(width: 100))], delegate: PreferredSizeDelegate(preferredSize: const Size(10, 10)), + children: [LayoutWithMissingId(child: Container(width: 100))], ), ), tester: tester, @@ -384,12 +384,12 @@ void main() { await expectFlutterErrorMessage( widget: Center( child: CustomMultiChildLayout( + delegate: ZeroAndOneIdLayoutDelegate(), children: [ LayoutId(id: 0, child: Container(width: 100)), LayoutId(id: 1, child: Container(width: 100)), LayoutId(id: 2, child: Container(width: 100)), ], - delegate: ZeroAndOneIdLayoutDelegate(), ), ), tester: tester, @@ -406,13 +406,13 @@ void main() { await expectFlutterErrorMessage( widget: Center( child: CustomMultiChildLayout( + delegate: ZeroAndOneIdLayoutDelegate(), children: [ LayoutId(id: 0, child: Container(width: 100)), LayoutId(id: 1, child: Container(width: 100)), LayoutId(id: 2, child: Container(width: 100)), LayoutId(id: 3, child: Container(width: 100)), ], - delegate: ZeroAndOneIdLayoutDelegate(), ), ), tester: tester, diff --git a/packages/flutter/test/widgets/custom_painter_test.dart b/packages/flutter/test/widgets/custom_painter_test.dart index c1c6526c9b..f6b4433395 100644 --- a/packages/flutter/test/widgets/custom_painter_test.dart +++ b/packages/flutter/test/widgets/custom_painter_test.dart @@ -125,10 +125,6 @@ void _defineTests() { ), ), ), - child: Semantics( - container: true, - child: const Text('Hello', textDirection: TextDirection.ltr), - ), foregroundPainter: _PainterWithSemantics( semantics: const CustomPainterSemantics( rect: Rect.fromLTRB(1.0, 1.0, 2.0, 2.0), @@ -138,6 +134,10 @@ void _defineTests() { ), ), ), + child: Semantics( + container: true, + child: const Text('Hello', textDirection: TextDirection.ltr), + ), )); expect(semanticsTester, hasSemantics( diff --git a/packages/flutter/test/widgets/default_text_style_test.dart b/packages/flutter/test/widgets/default_text_style_test.dart index 7ac0e6c800..ddd9c6a986 100644 --- a/packages/flutter/test/widgets/default_text_style_test.dart +++ b/packages/flutter/test/widgets/default_text_style_test.dart @@ -58,8 +58,8 @@ void main() { await tester.pumpWidget(const AnimatedDefaultTextStyle( style: s1, - child: textWidget, duration: Duration(milliseconds: 1000), + child: textWidget, )); final RichText text1 = tester.firstWidget(find.byType(RichText)); @@ -80,8 +80,8 @@ void main() { maxLines: 3, textWidthBasis: TextWidthBasis.longestLine, textHeightBehavior: ui.TextHeightBehavior(applyHeightToFirstAscent: false), - child: textWidget, duration: Duration(milliseconds: 1000), + child: textWidget, )); final RichText text2 = tester.firstWidget(find.byType(RichText)); diff --git a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart index dcf6ee87f4..e9e6adb6c7 100644 --- a/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart +++ b/packages/flutter/test/widgets/draggable_scrollable_sheet_test.dart @@ -23,8 +23,8 @@ void main() { child: Stack( children: [ TextButton( - child: const Text('TapHere'), onPressed: onButtonPressed, + child: const Text('TapHere'), ), DraggableScrollableSheet( maxChildSize: maxChildSize, diff --git a/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart b/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart index 788e1b0649..8d5ddd07cd 100644 --- a/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart +++ b/packages/flutter/test/widgets/editable_text_show_on_screen_test.dart @@ -244,10 +244,10 @@ void main() { color: Colors.red, ), Container( + color: Colors.green, child: TextField( controller: textController, ), - color: Colors.green, ), Container( color: Colors.red, diff --git a/packages/flutter/test/widgets/ensure_visible_test.dart b/packages/flutter/test/widgets/ensure_visible_test.dart index 36ace604c0..2c54de04ea 100644 --- a/packages/flutter/test/widgets/ensure_visible_test.dart +++ b/packages/flutter/test/widgets/ensure_visible_test.dart @@ -729,7 +729,7 @@ void main() { SliverToBoxAdapter(child: SizedBox(key: ValueKey(-3), width: 200.0, height: 200.0)), SliverToBoxAdapter(child: SizedBox(key: ValueKey(-2), width: 200.0, height: 200.0)), SliverToBoxAdapter(child: SizedBox(key: ValueKey(-1), width: 200.0, height: 200.0)), - SliverToBoxAdapter(child: SizedBox(key: ValueKey(0), width: 200.0, height: 200.0), key: ValueKey('center')), + SliverToBoxAdapter(key: ValueKey('center'), child: SizedBox(key: ValueKey(0), width: 200.0, height: 200.0)), SliverToBoxAdapter(child: SizedBox(key: ValueKey(1), width: 200.0, height: 200.0)), SliverToBoxAdapter(child: SizedBox(key: ValueKey(2), width: 200.0, height: 200.0)), SliverToBoxAdapter(child: SizedBox(key: ValueKey(3), width: 200.0, height: 200.0)), diff --git a/packages/flutter/test/widgets/fitted_box_test.dart b/packages/flutter/test/widgets/fitted_box_test.dart index d71c60ab84..709123ca41 100644 --- a/packages/flutter/test/widgets/fitted_box_test.dart +++ b/packages/flutter/test/widgets/fitted_box_test.dart @@ -481,7 +481,7 @@ void main() { final RenderFittedBox renderObject = tester.allRenderObjects.whereType().first; expect(renderObject.clipBehavior, equals(Clip.none)); - await tester.pumpWidget(FittedBox(fit: BoxFit.none, child: Container(), clipBehavior: Clip.antiAlias)); + await tester.pumpWidget(FittedBox(fit: BoxFit.none, clipBehavior: Clip.antiAlias, child: Container())); expect(renderObject.clipBehavior, equals(Clip.antiAlias)); }); diff --git a/packages/flutter/test/widgets/flow_test.dart b/packages/flutter/test/widgets/flow_test.dart index 7e07bdd096..9d92e0957d 100644 --- a/packages/flutter/test/widgets/flow_test.dart +++ b/packages/flutter/test/widgets/flow_test.dart @@ -175,10 +175,10 @@ void main() { await tester.pumpWidget( Flow( delegate: OpacityFlowDelegate(opacity), + clipBehavior: clip, children: const [ SizedBox(width: 100.0, height: 100.0), ], - clipBehavior: clip, ), ); expect(renderObject.clipBehavior, clip); @@ -204,10 +204,10 @@ void main() { await tester.pumpWidget( Flow.unwrapped( delegate: OpacityFlowDelegate(opacity), + clipBehavior: clip, children: const [ SizedBox(width: 100.0, height: 100.0), ], - clipBehavior: clip, ), ); expect(renderObject.clipBehavior, clip); diff --git a/packages/flutter/test/widgets/gesture_detector_test.dart b/packages/flutter/test/widgets/gesture_detector_test.dart index 012c727759..e8acdb3647 100644 --- a/packages/flutter/test/widgets/gesture_detector_test.dart +++ b/packages/flutter/test/widgets/gesture_detector_test.dart @@ -762,8 +762,8 @@ void main() { }, ), }, - child: Container(), semantics: _EmptySemanticsGestureDelegate(), + child: Container(), )); key.currentState!.debugFillProperties(builder); @@ -785,9 +785,9 @@ void main() { await tester.pumpWidget(RawGestureDetector( key: key, gestures: const {}, - child: Container(), semantics: _EmptySemanticsGestureDelegate(), excludeFromSemantics: true, + child: Container(), )); key.currentState!.debugFillProperties(builder); diff --git a/packages/flutter/test/widgets/grid_view_test.dart b/packages/flutter/test/widgets/grid_view_test.dart index c0f87cdde6..c70f4fd586 100644 --- a/packages/flutter/test/widgets/grid_view_test.dart +++ b/packages/flutter/test/widgets/grid_view_test.dart @@ -632,8 +632,8 @@ void main() { textDirection: TextDirection.ltr, child: GridView( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3), - children: [Container(height: 2000.0)], clipBehavior: Clip.antiAlias, + children: [Container(height: 2000.0)], ), ), ); @@ -684,8 +684,8 @@ void main() { textDirection: TextDirection.ltr, child: GridView.count( crossAxisCount: 3, - children: [Container(height: 2000.0)], clipBehavior: Clip.antiAlias, + children: [Container(height: 2000.0)], ), ), ); @@ -699,8 +699,8 @@ void main() { textDirection: TextDirection.ltr, child: GridView.extent( maxCrossAxisExtent: 1000, - children: [Container(height: 2000.0)], clipBehavior: Clip.antiAlias, + children: [Container(height: 2000.0)], ), ), ); diff --git a/packages/flutter/test/widgets/heroes_test.dart b/packages/flutter/test/widgets/heroes_test.dart index 36d9295c12..c7a6638b4c 100644 --- a/packages/flutter/test/widgets/heroes_test.dart +++ b/packages/flutter/test/widgets/heroes_test.dart @@ -148,7 +148,7 @@ class ThreeRoute extends MaterialPageRoute { class MutatingRoute extends MaterialPageRoute { MutatingRoute() : super(builder: (BuildContext context) { - return Hero(tag: 'a', child: const Text('MutatingRoute'), key: UniqueKey()); + return Hero(tag: 'a', key: UniqueKey(), child: const Text('MutatingRoute')); }); void markNeedsBuild() { diff --git a/packages/flutter/test/widgets/implicit_animations_test.dart b/packages/flutter/test/widgets/implicit_animations_test.dart index bdc54f1684..b9a356ce40 100644 --- a/packages/flutter/test/widgets/implicit_animations_test.dart +++ b/packages/flutter/test/widgets/implicit_animations_test.dart @@ -406,10 +406,10 @@ class _TestAnimatedContainerWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return AnimatedContainer( - child: child, duration: duration, onEnd: widget.callback, width: toggle ? 10 : 20, + child: child, ); } } @@ -418,11 +418,11 @@ class _TestAnimatedPaddingWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return AnimatedPadding( - child: child, duration: duration, onEnd: widget.callback, padding: toggle ? const EdgeInsets.all(8.0) : const EdgeInsets.all(16.0), + child: child, ); } } @@ -431,10 +431,10 @@ class _TestAnimatedAlignWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return AnimatedAlign( - child: child, duration: duration, onEnd: widget.callback, alignment: toggle ? Alignment.topLeft : Alignment.bottomRight, + child: child, ); } } @@ -443,10 +443,10 @@ class _TestAnimatedPositionedWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return AnimatedPositioned( - child: child, duration: duration, onEnd: widget.callback, left: toggle ? 10 : 20, + child: child, ); } } @@ -455,10 +455,10 @@ class _TestAnimatedPositionedDirectionalWidgetState extends _TestAnimatedWidgetS @override Widget getAnimatedWidget() { return AnimatedPositionedDirectional( - child: child, duration: duration, onEnd: widget.callback, start: toggle ? 10 : 20, + child: child, ); } } @@ -467,10 +467,10 @@ class _TestAnimatedOpacityWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return AnimatedOpacity( - child: child, duration: duration, onEnd: widget.callback, opacity: toggle ? 1.0 : 0.0, + child: child, ); } } @@ -514,12 +514,12 @@ class _TestAnimatedDefaultTextStyleWidgetState extends _TestAnimatedWidgetState @override Widget getAnimatedWidget() { return AnimatedDefaultTextStyle( - child: child, duration: duration, onEnd: widget.callback, style: toggle ? const TextStyle(fontStyle: FontStyle.italic) : const TextStyle(fontStyle: FontStyle.normal), + child: child, ); } } @@ -528,13 +528,13 @@ class _TestAnimatedPhysicalModelWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return AnimatedPhysicalModel( - child: child, duration: duration, onEnd: widget.callback, color: toggle ? Colors.red : Colors.green, elevation: 0, shadowColor: Colors.blue, shape: BoxShape.rectangle, + child: child, ); } } @@ -543,15 +543,15 @@ class _TestTweenAnimationBuilderWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return TweenAnimationBuilder( - child: child, tween: Tween(begin: 1, end: 2), duration: duration, onEnd: widget.callback, + child: child, builder: (BuildContext context, double? size, Widget? child) { return SizedBox( - child: child, width: size, height: size, + child: child, ); }, ); @@ -562,10 +562,10 @@ class _TestAnimatedThemeWidgetState extends _TestAnimatedWidgetState { @override Widget getAnimatedWidget() { return AnimatedTheme( - child: child, data: toggle ? ThemeData.dark() : ThemeData.light(), duration: duration, onEnd: widget.callback, + child: child, ); } } diff --git a/packages/flutter/test/widgets/inherited_test.dart b/packages/flutter/test/widgets/inherited_test.dart index 67bfbb748b..c6b96506c2 100644 --- a/packages/flutter/test/widgets/inherited_test.dart +++ b/packages/flutter/test/widgets/inherited_test.dart @@ -73,12 +73,12 @@ void main() { expect(log, equals([first])); - final TestInherited second = TestInherited(child: builder, shouldNotify: false); + final TestInherited second = TestInherited(shouldNotify: false, child: builder); await tester.pumpWidget(second); expect(log, equals([first])); - final TestInherited third = TestInherited(child: builder, shouldNotify: true); + final TestInherited third = TestInherited(shouldNotify: true, child: builder); await tester.pumpWidget(third); expect(log, equals([first, third])); diff --git a/packages/flutter/test/widgets/list_view_test.dart b/packages/flutter/test/widgets/list_view_test.dart index 2bdda4c3c3..66b0ae772e 100644 --- a/packages/flutter/test/widgets/list_view_test.dart +++ b/packages/flutter/test/widgets/list_view_test.dart @@ -589,8 +589,8 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: ListView( - children: [Container(height: 2000.0)], clipBehavior: Clip.antiAlias, + children: [Container(height: 2000.0)], ), ), ); diff --git a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart index 46ac0c929c..1508ea9992 100644 --- a/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart +++ b/packages/flutter/test/widgets/list_wheel_scroll_view_test.dart @@ -36,8 +36,8 @@ void main() { textDirection: TextDirection.ltr, child: ListWheelScrollView( itemExtent: 2000.0, // huge extent to trigger clip - children: [Container()], clipBehavior: Clip.antiAlias, + children: [Container()], ), ), ); diff --git a/packages/flutter/test/widgets/mouse_region_test.dart b/packages/flutter/test/widgets/mouse_region_test.dart index 038a7263c9..487638c689 100644 --- a/packages/flutter/test/widgets/mouse_region_test.dart +++ b/packages/flutter/test/widgets/mouse_region_test.dart @@ -598,14 +598,14 @@ void main() { return Container( alignment: Alignment.topLeft, child: MouseRegion( + onEnter: onEnter, + onHover: onHover, + onExit: onExit, child: Container( color: const Color.fromARGB(0xff, 0xff, 0x00, 0x00), width: 100.0, height: 100.0, ), - onEnter: onEnter, - onHover: onHover, - onExit: onExit, ), ); } @@ -1143,7 +1143,7 @@ void main() { if (opaque == null) { return MouseRegion(onEnter: onEnter, onHover: onHover, onExit: onExit, child: child); } - return MouseRegion(onEnter: onEnter, onHover: onHover, onExit: onExit, child: child, opaque: opaque); + return MouseRegion(onEnter: onEnter, onHover: onHover, onExit: onExit, opaque: opaque, child: child); } return Directionality( diff --git a/packages/flutter/test/widgets/opacity_test.dart b/packages/flutter/test/widgets/opacity_test.dart index ff9d9bf019..2845634214 100644 --- a/packages/flutter/test/widgets/opacity_test.dart +++ b/packages/flutter/test/widgets/opacity_test.dart @@ -16,8 +16,8 @@ void main() { // Opacity 1.0: Semantics and painting await tester.pumpWidget( const Opacity( - child: Text('a', textDirection: TextDirection.rtl), opacity: 1.0, + child: Text('a', textDirection: TextDirection.rtl), ), ); expect(semantics, hasSemantics( @@ -37,8 +37,8 @@ void main() { // Opacity 0.0: Nothing await tester.pumpWidget( const Opacity( - child: Text('a', textDirection: TextDirection.rtl), opacity: 0.0, + child: Text('a', textDirection: TextDirection.rtl), ), ); expect(semantics, hasSemantics( @@ -49,9 +49,9 @@ void main() { // Opacity 0.0 with semantics: Just semantics await tester.pumpWidget( const Opacity( - child: Text('a', textDirection: TextDirection.rtl), opacity: 0.0, alwaysIncludeSemantics: true, + child: Text('a', textDirection: TextDirection.rtl), ), ); expect(semantics, hasSemantics( @@ -71,9 +71,9 @@ void main() { // Opacity 0.0 without semantics: Nothing await tester.pumpWidget( const Opacity( - child: Text('a', textDirection: TextDirection.rtl), opacity: 0.0, alwaysIncludeSemantics: false, + child: Text('a', textDirection: TextDirection.rtl), ), ); expect(semantics, hasSemantics( @@ -84,8 +84,8 @@ void main() { // Opacity 0.1: Semantics and painting await tester.pumpWidget( const Opacity( - child: Text('a', textDirection: TextDirection.rtl), opacity: 0.1, + child: Text('a', textDirection: TextDirection.rtl), ), ); expect(semantics, hasSemantics( @@ -105,9 +105,9 @@ void main() { // Opacity 0.1 without semantics: Still has semantics and painting await tester.pumpWidget( const Opacity( - child: Text('a', textDirection: TextDirection.rtl), opacity: 0.1, alwaysIncludeSemantics: false, + child: Text('a', textDirection: TextDirection.rtl), ), ); expect(semantics, hasSemantics( @@ -127,9 +127,9 @@ void main() { // Opacity 0.1 with semantics: Semantics and painting await tester.pumpWidget( const Opacity( - child: Text('a', textDirection: TextDirection.rtl), opacity: 0.1, alwaysIncludeSemantics: true, + child: Text('a', textDirection: TextDirection.rtl), ), ); expect(semantics, hasSemantics( diff --git a/packages/flutter/test/widgets/overscroll_indicator_test.dart b/packages/flutter/test/widgets/overscroll_indicator_test.dart index 5341fdfda7..e9d3ce748a 100644 --- a/packages/flutter/test/widgets/overscroll_indicator_test.dart +++ b/packages/flutter/test/widgets/overscroll_indicator_test.dart @@ -545,9 +545,9 @@ class TestScrollBehavior1 extends ScrollBehavior { @override Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) { return GlowingOverscrollIndicator( - child: child, axisDirection: details.direction, color: const Color(0xFF00FF00), + child: child, ); } } @@ -558,9 +558,9 @@ class TestScrollBehavior2 extends ScrollBehavior { @override Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) { return GlowingOverscrollIndicator( - child: child, axisDirection: details.direction, color: const Color(0xFF0000FF), + child: child, ); } } diff --git a/packages/flutter/test/widgets/page_view_test.dart b/packages/flutter/test/widgets/page_view_test.dart index c5daa57529..2207fd229b 100644 --- a/packages/flutter/test/widgets/page_view_test.dart +++ b/packages/flutter/test/widgets/page_view_test.dart @@ -343,11 +343,11 @@ void main() { if (size != null) { return OverflowBox( - child: pageView, minWidth: size.width, minHeight: size.height, maxWidth: size.width, maxHeight: size.height, + child: pageView, ); } else { return pageView; @@ -699,8 +699,8 @@ void main() { child: SizedBox.fromSize( size: size, child: PageView( - children: kStates.map((String state) => Text(state)).toList(), controller: controller, + children: kStates.map((String state) => Text(state)).toList(), onPageChanged: (int page) { }, ), ), @@ -736,9 +736,8 @@ void main() { return Directionality( textDirection: TextDirection.ltr, child: PageView( - children: - kStates.map((String state) => Text(state)).toList(), controller: controller, + children: kStates.map((String state) => Text(state)).toList(), onPageChanged: (int page) { changeIndex = page; }, @@ -844,8 +843,8 @@ void main() { controller: controller, children: List.generate(3, (int i) { return Semantics( - child: Text('Page #$i'), container: true, + child: Text('Page #$i'), ); }), ), @@ -898,8 +897,8 @@ void main() { controller: pageController, children: List.generate(3, (int i) { return Semantics( - child: Text('Page #$i'), container: true, + child: Text('Page #$i'), ); }), ), @@ -917,13 +916,13 @@ void main() { textDirection: TextDirection.ltr, child: PageView( controller: controller, + allowImplicitScrolling: true, children: List.generate(4, (int i) { return Semantics( - child: Text('Page #$i'), container: true, + child: Text('Page #$i'), ); }), - allowImplicitScrolling: true, ), )); expect(controller.page, 0); @@ -975,8 +974,8 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: PageView( - children: [Container(height: 2000.0)], clipBehavior: Clip.antiAlias, + children: [Container(height: 2000.0)], ), ), ); diff --git a/packages/flutter/test/widgets/platform_view_test.dart b/packages/flutter/test/widgets/platform_view_test.dart index 5e3dcd1428..16303ea7c7 100644 --- a/packages/flutter/test/widgets/platform_view_test.dart +++ b/packages/flutter/test/widgets/platform_view_test.dart @@ -2520,7 +2520,7 @@ void main() { Center( child: Column( children: [ - SizedBox(child: platformViewLink, width: 300, height: 300), + SizedBox(width: 300, height: 300, child: platformViewLink), Focus( debugLabel: 'container', child: Container(key: containerKey), diff --git a/packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart b/packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart index 066ba2f075..8f5f9132eb 100644 --- a/packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart +++ b/packages/flutter/test/widgets/range_maintaining_scroll_physics_test.dart @@ -40,8 +40,8 @@ class _ExpandingBoxState extends State with AutomaticKeepAliveClie child: Align( alignment: Alignment.bottomCenter, child: TextButton( - child: const Text('Collapse'), onPressed: toggleSize, + child: const Text('Collapse'), ), ), ); diff --git a/packages/flutter/test/widgets/reorderable_list_test.dart b/packages/flutter/test/widgets/reorderable_list_test.dart index 60727bc19a..264bcc25bd 100644 --- a/packages/flutter/test/widgets/reorderable_list_test.dart +++ b/packages/flutter/test/widgets/reorderable_list_test.dart @@ -418,8 +418,8 @@ void main() { key: ValueKey(items[index]), height: 100, child: ReorderableDragStartListener( - child: Text('item ${items[index]}'), index: index, + child: Text('item ${items[index]}'), ), ); }, @@ -464,9 +464,9 @@ void main() { key: ValueKey(items[index]), height: 100, child: ReorderableDragStartListener( - child: Text('item ${items[index]}'), index: index, enabled: false, + child: Text('item ${items[index]}'), ), ); }, @@ -513,8 +513,8 @@ void main() { key: ValueKey(items[index]), height: 100, child: ReorderableDelayedDragStartListener( - child: Text('item ${items[index]}'), index: index, + child: Text('item ${items[index]}'), ), ); }, @@ -560,9 +560,9 @@ void main() { key: ValueKey(items[index]), height: 100, child: ReorderableDelayedDragStartListener( - child: Text('item ${items[index]}'), index: index, enabled: false, + child: Text('item ${items[index]}'), ), ); }, @@ -626,6 +626,7 @@ class _TestListState extends State { height: 100, color: items[index].isOdd ? Colors.red : Colors.green, child: ReorderableDragStartListener( + index: index, child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -633,7 +634,6 @@ class _TestListState extends State { const Icon(Icons.drag_handle), ], ), - index: index, ), ); }, diff --git a/packages/flutter/test/widgets/routes_test.dart b/packages/flutter/test/widgets/routes_test.dart index 97031546bd..13243ca6af 100644 --- a/packages/flutter/test/widgets/routes_test.dart +++ b/packages/flutter/test/widgets/routes_test.dart @@ -1937,9 +1937,9 @@ class _TestDialogRouteWithCustomBarrierCurve extends PopupRoute { @override Widget buildPage(BuildContext context, Animation animation, Animation secondaryAnimation) { return Semantics( - child: _child, scopesRoute: true, explicitChildNodes: true, + child: _child, ); } } diff --git a/packages/flutter/test/widgets/scroll_activity_test.dart b/packages/flutter/test/widgets/scroll_activity_test.dart index 247e5f35ee..07a9805d4d 100644 --- a/packages/flutter/test/widgets/scroll_activity_test.dart +++ b/packages/flutter/test/widgets/scroll_activity_test.dart @@ -15,13 +15,13 @@ List children(int n) { void main() { testWidgets('Scrolling with list view changes', (WidgetTester tester) async { final ScrollController controller = ScrollController(); - await tester.pumpWidget(MaterialApp(home: ListView(children: children(30), controller: controller))); + await tester.pumpWidget(MaterialApp(home: ListView(controller: controller, children: children(30)))); final double thirty = controller.position.maxScrollExtent; controller.jumpTo(thirty); await tester.pump(); controller.jumpTo(thirty + 100.0); // past the end await tester.pump(); - await tester.pumpWidget(MaterialApp(home: ListView(children: children(31), controller: controller))); + await tester.pumpWidget(MaterialApp(home: ListView(controller: controller, children: children(31)))); expect(controller.position.pixels, thirty + 200.0); // same distance past the end expect(await tester.pumpAndSettle(), 7); // now it goes ballistic... expect(controller.position.pixels, thirty + 100.0); // and ends up at the end diff --git a/packages/flutter/test/widgets/scroll_notification_test.dart b/packages/flutter/test/widgets/scroll_notification_test.dart index 30ce8cf793..726d8ea583 100644 --- a/packages/flutter/test/widgets/scroll_notification_test.dart +++ b/packages/flutter/test/widgets/scroll_notification_test.dart @@ -72,8 +72,8 @@ void main() { child: Container( padding: const EdgeInsets.all(50.0), child: const SingleChildScrollView( - child: SizedBox(height: 1200.0), dragStartBehavior: DragStartBehavior.down, + child: SizedBox(height: 1200.0), ), ), ), @@ -121,8 +121,8 @@ void main() { child: Container( padding: const EdgeInsets.all(50.0), child: const SingleChildScrollView( - child: SizedBox(height: 1200.0), dragStartBehavior: DragStartBehavior.down, + child: SizedBox(height: 1200.0), ), ), ), diff --git a/packages/flutter/test/widgets/scroll_view_test.dart b/packages/flutter/test/widgets/scroll_view_test.dart index 81e5063b02..84beaedd7b 100644 --- a/packages/flutter/test/widgets/scroll_view_test.dart +++ b/packages/flutter/test/widgets/scroll_view_test.dart @@ -68,12 +68,12 @@ void main() { onTap: () { log.add(state); }, + dragStartBehavior: DragStartBehavior.down, child: Container( height: 200.0, color: const Color(0xFF0000FF), child: Text(state), ), - dragStartBehavior: DragStartBehavior.down, ); }).toList(), ), diff --git a/packages/flutter/test/widgets/scrollable_animations_test.dart b/packages/flutter/test/widgets/scrollable_animations_test.dart index 4b8f6aef91..fc4906a388 100644 --- a/packages/flutter/test/widgets/scrollable_animations_test.dart +++ b/packages/flutter/test/widgets/scrollable_animations_test.dart @@ -13,8 +13,8 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: ListView( - children: List.generate(80, (int i) => Text('$i', textDirection: TextDirection.ltr)), controller: controller, + children: List.generate(80, (int i) => Text('$i', textDirection: TextDirection.ltr)), ), ), ); @@ -33,8 +33,8 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: ListView( - children: List.generate(80, (int i) => Text('$i', textDirection: TextDirection.ltr)), controller: controller, + children: List.generate(80, (int i) => Text('$i', textDirection: TextDirection.ltr)), ), ), ); @@ -56,8 +56,8 @@ void main() { Directionality( textDirection: TextDirection.ltr, child: ListView( - children: List.generate(80, (int i) => Text('$i', textDirection: TextDirection.ltr)), controller: controller, + children: List.generate(80, (int i) => Text('$i', textDirection: TextDirection.ltr)), ), ), ); diff --git a/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart b/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart index 7c27443d1d..b3eee56473 100644 --- a/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart +++ b/packages/flutter/test/widgets/scrollable_list_hit_testing_test.dart @@ -24,8 +24,8 @@ void main() { children: items.map((int item) { return GestureDetector( onTap: () { tapped.add(item); }, - child: Text('$item'), dragStartBehavior: DragStartBehavior.down, + child: Text('$item'), ); }).toList(), ), @@ -66,8 +66,8 @@ void main() { children: items.map((int item) { return GestureDetector( onTap: () { tapped.add(item); }, - child: Text('$item'), dragStartBehavior: DragStartBehavior.down, + child: Text('$item'), ); }).toList(), ), diff --git a/packages/flutter/test/widgets/scrollable_semantics_test.dart b/packages/flutter/test/widgets/scrollable_semantics_test.dart index 40f926ec87..f79e52f52e 100644 --- a/packages/flutter/test/widgets/scrollable_semantics_test.dart +++ b/packages/flutter/test/widgets/scrollable_semantics_test.dart @@ -155,8 +155,8 @@ void main() { final List slivers = List.generate(30, (int i) { final Widget child = MergeSemantics( child: SizedBox( - child: Text('Item $i'), height: 72.0, + child: Text('Item $i'), ), ); children.add(child); @@ -309,8 +309,8 @@ void main() { semantics = SemanticsTester(tester); final List children = List.generate(80, (int i) => SizedBox( - child: Text('Item $i'), height: 40.0, + child: Text('Item $i'), )); await tester.pumpWidget( Directionality( @@ -337,8 +337,8 @@ void main() { child: ListView( children: List.generate(40, (int i) { return SizedBox( - child: Text('item $i'), height: 400.0, + child: Text('item $i'), ); }), ), diff --git a/packages/flutter/test/widgets/semantics_1_test.dart b/packages/flutter/test/widgets/semantics_1_test.dart index 8161794c51..4ec238d2e8 100644 --- a/packages/flutter/test/widgets/semantics_1_test.dart +++ b/packages/flutter/test/widgets/semantics_1_test.dart @@ -19,8 +19,8 @@ void main() { child: Semantics( label: 'test1', textDirection: TextDirection.ltr, - child: Container(), selected: true, + child: Container(), ), ), ); diff --git a/packages/flutter/test/widgets/shader_mask_test.dart b/packages/flutter/test/widgets/shader_mask_test.dart index c3fd9b9f61..f00b5d439c 100644 --- a/packages/flutter/test/widgets/shader_mask_test.dart +++ b/packages/flutter/test/widgets/shader_mask_test.dart @@ -18,7 +18,7 @@ Shader createShader(Rect bounds) { void main() { testWidgets('Can be constructed', (WidgetTester tester) async { const Widget child = SizedBox(width: 100.0, height: 100.0); - await tester.pumpWidget(const ShaderMask(child: child, shaderCallback: createShader)); + await tester.pumpWidget(const ShaderMask(shaderCallback: createShader, child: child)); }); testWidgets('Bounds rect includes offset', (WidgetTester tester) async { diff --git a/packages/flutter/test/widgets/sliver_appbar_opacity_test.dart b/packages/flutter/test/widgets/sliver_appbar_opacity_test.dart index 4cba8292ff..474af5272c 100644 --- a/packages/flutter/test/widgets/sliver_appbar_opacity_test.dart +++ b/packages/flutter/test/widgets/sliver_appbar_opacity_test.dart @@ -241,8 +241,8 @@ class _TestWidget extends StatelessWidget { SliverList( delegate: SliverChildListDelegate(List.generate(20, (int i) { return SizedBox( - child: Text('Tile $i'), height: 100.0, + child: Text('Tile $i'), ); })), ), diff --git a/packages/flutter/test/widgets/sliver_fill_remaining_test.dart b/packages/flutter/test/widgets/sliver_fill_remaining_test.dart index a85ef10121..6d713142ca 100644 --- a/packages/flutter/test/widgets/sliver_fill_remaining_test.dart +++ b/packages/flutter/test/widgets/sliver_fill_remaining_test.dart @@ -143,8 +143,8 @@ void main() { final List slivers = [ sliverBox, SliverFillRemaining( - child: Container(color: Colors.white), hasScrollBody: false, + child: Container(color: Colors.white), ), ]; @@ -296,8 +296,8 @@ void main() { mainAxisSize: MainAxisSize.min, children: [ const Flexible( - child: Center(child: FlutterLogo(size: 100)), fit: FlexFit.loose, + child: Center(child: FlutterLogo(size: 100)), ), ElevatedButton( child: const Text('Bottom'), @@ -568,8 +568,8 @@ void main() { mainAxisSize: MainAxisSize.min, children: [ const Flexible( - child: Center(child: FlutterLogo(size: 100)), fit: FlexFit.loose, + child: Center(child: FlutterLogo(size: 100)), ), ElevatedButton( child: const Text('Bottom'), diff --git a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart index 046facf4b6..de366e5207 100644 --- a/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart +++ b/packages/flutter/test/widgets/slivers_appbar_floating_pinned_test.dart @@ -321,8 +321,8 @@ void main() { SliverList( delegate: SliverChildListDelegate(List.generate(20, (int i) { return SizedBox( - child: Text('Tile $i'), height: 100.0, + child: Text('Tile $i'), ); })), ), diff --git a/packages/flutter/test/widgets/slivers_evil_test.dart b/packages/flutter/test/widgets/slivers_evil_test.dart index 8b035674b8..eec0b3a918 100644 --- a/packages/flutter/test/widgets/slivers_evil_test.dart +++ b/packages/flutter/test/widgets/slivers_evil_test.dart @@ -37,9 +37,9 @@ class TestBehavior extends ScrollBehavior { @override Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) { return GlowingOverscrollIndicator( - child: child, axisDirection: details.direction, color: const Color(0xFFFFFFFF), + child: child, ); } } diff --git a/packages/flutter/test/widgets/slivers_keepalive_test.dart b/packages/flutter/test/widgets/slivers_keepalive_test.dart index 5247eb1fcc..03d8d0cb43 100644 --- a/packages/flutter/test/widgets/slivers_keepalive_test.dart +++ b/packages/flutter/test/widgets/slivers_keepalive_test.dart @@ -278,7 +278,7 @@ void main() { const WidgetTest2(text: 'child 2', keepAlive: true), ]; await tester.pumpWidget( - SwitchingChildListTest(children: childList, viewportFraction: 0.1), + SwitchingChildListTest(viewportFraction: 0.1, children: childList), ); final _WidgetTest0State state0 = tester.state(find.byType(WidgetTest0)); final _WidgetTest1State state1 = tester.state(find.byType(WidgetTest1)); @@ -289,22 +289,22 @@ void main() { childList = createSwitchedChildList(childList, 0, 2); await tester.pumpWidget( - SwitchingChildListTest(children: childList, viewportFraction: 0.1), + SwitchingChildListTest(viewportFraction: 0.1, children: childList), ); childList = createSwitchedChildList(childList, 0, 1); await tester.pumpWidget( - SwitchingChildListTest(children: childList, viewportFraction: 0.1), + SwitchingChildListTest(viewportFraction: 0.1, children: childList), ); childList = createSwitchedChildList(childList, 1, 2); await tester.pumpWidget( - SwitchingChildListTest(children: childList, viewportFraction: 0.1), + SwitchingChildListTest(viewportFraction: 0.1, children: childList), ); childList = createSwitchedChildList(childList, 0, 1); await tester.pumpWidget( - SwitchingChildListTest(children: childList, viewportFraction: 0.1), + SwitchingChildListTest(viewportFraction: 0.1, children: childList), ); expect(state0.hasBeenDisposed, false); @@ -319,7 +319,7 @@ void main() { WidgetTest2(text: 'child 2', key: UniqueKey()), ]; await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); final _WidgetTest0State state0 = tester.state(find.byType(WidgetTest0)); final _WidgetTest1State state1 = tester.state(find.byType(WidgetTest1)); @@ -330,32 +330,32 @@ void main() { childList = createSwitchedChildList(childList, 0, 2); await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); childList = createSwitchedChildList(childList, 1, 2); await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); childList = createSwitchedChildList(childList, 1, 2); await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); childList = createSwitchedChildList(childList, 0, 1); await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); childList = createSwitchedChildList(childList, 0, 2); await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); childList = createSwitchedChildList(childList, 0, 1); await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); expect(state0.hasBeenDisposed, false); expect(state1.hasBeenDisposed, true); @@ -369,7 +369,7 @@ void main() { WidgetTest2(text: 'child 2', key: UniqueKey()), ]; await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); final _WidgetTest0State state0 = tester.state(find.byType(WidgetTest0)); final _WidgetTest1State state1 = tester.state(find.byType(WidgetTest1)); @@ -381,7 +381,7 @@ void main() { childList = createSwitchedChildList(childList, 0, 1); childList.removeAt(2); await tester.pumpWidget( - SwitchingSliverListTest(children: childList, viewportFraction: 0.1), + SwitchingSliverListTest(viewportFraction: 0.1, children: childList), ); expect(find.text('child 0'), findsOneWidget); expect(find.text('child 1'), findsOneWidget); diff --git a/packages/flutter/test/widgets/stack_test.dart b/packages/flutter/test/widgets/stack_test.dart index 47252e8b82..9e19c09e19 100644 --- a/packages/flutter/test/widgets/stack_test.dart +++ b/packages/flutter/test/widgets/stack_test.dart @@ -249,17 +249,17 @@ void main() { itemsPainted = []; final List items = List.generate(itemCount, (int i) { return CustomPaint( - child: Text('$i', textDirection: TextDirection.ltr), painter: TestCallbackPainter( onPaint: () { itemsPainted.add(i); }, ), + child: Text('$i', textDirection: TextDirection.ltr), ); }); return Center( child: IndexedStack( alignment: Alignment.topLeft, - children: items, index: index, + children: items, ), ); } @@ -290,9 +290,9 @@ void main() { return Center( child: IndexedStack( alignment: Alignment.topLeft, - children: items, key: key, index: index, + children: items, ), ); } diff --git a/packages/flutter/test/widgets/title_test.dart b/packages/flutter/test/widgets/title_test.dart index 9e7a91eaad..fd5cc56cdb 100644 --- a/packages/flutter/test/widgets/title_test.dart +++ b/packages/flutter/test/widgets/title_test.dart @@ -18,8 +18,8 @@ void main() { testWidgets('should handle having no title', (WidgetTester tester) async { final Title widget = Title( - child: Container(), color: const Color(0xFF00FF00), + child: Container(), ); expect(widget.toString, isNot(throwsException)); expect(widget.title, equals('')); @@ -41,8 +41,8 @@ void main() { }); await tester.pumpWidget(Title( - child: Container(), color: const Color(0xFF00FF00), + child: Container(), )); expect(log, hasLength(1)); diff --git a/packages/flutter/test/widgets/transitions_test.dart b/packages/flutter/test/widgets/transitions_test.dart index 7e71e9520b..3b6b732e74 100644 --- a/packages/flutter/test/widgets/transitions_test.dart +++ b/packages/flutter/test/widgets/transitions_test.dart @@ -182,9 +182,9 @@ void main() { ).animate(controller); final Widget widget = AlignTransition( alignment: alignmentTween, - child: const Text('Ready', textDirection: TextDirection.ltr), widthFactor: 0.3, heightFactor: 0.4, + child: const Text('Ready', textDirection: TextDirection.ltr), ); await tester.pumpWidget(widget); diff --git a/packages/flutter/test/widgets/visibility_test.dart b/packages/flutter/test/widgets/visibility_test.dart index 9492e301ba..7f8da4afc9 100644 --- a/packages/flutter/test/widgets/visibility_test.dart +++ b/packages/flutter/test/widgets/visibility_test.dart @@ -78,7 +78,7 @@ void main() { expect(log, ['created new state', 'tap']); log.clear(); - await tester.pumpWidget(Visibility(child: testChild, visible: false)); + await tester.pumpWidget(Visibility(visible: false, child: testChild)); expect(find.byType(Text, skipOffstage: false), findsNothing); expect(find.byType(Visibility), paintsNothing); expect(tester.getSize(find.byType(Visibility)), const Size(800.0, 600.0)); @@ -90,8 +90,8 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsNothing); @@ -141,13 +141,13 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: true, maintainState: true, maintainAnimation: true, maintainSize: true, maintainInteractivity: true, maintainSemantics: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -163,13 +163,13 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, maintainState: true, maintainAnimation: true, maintainSize: true, maintainInteractivity: true, maintainSemantics: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -185,12 +185,12 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, maintainState: true, maintainAnimation: true, maintainSize: true, maintainInteractivity: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -206,12 +206,12 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, maintainState: true, maintainAnimation: true, maintainSize: true, maintainSemantics: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -227,11 +227,11 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, maintainState: true, maintainAnimation: true, maintainSize: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -247,10 +247,10 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, maintainState: true, maintainAnimation: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -267,9 +267,9 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, maintainState: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -288,9 +288,9 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: true, maintainState: true, + child: testChild, ), )); expect(find.byType(Text), findsOneWidget); @@ -306,9 +306,9 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, maintainState: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -325,9 +325,9 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: true, maintainState: true, + child: testChild, ), )); expect(find.byType(Text), findsOneWidget); @@ -343,9 +343,9 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, maintainState: true, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget); @@ -364,8 +364,8 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsNothing); @@ -380,8 +380,8 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: true, + child: testChild, ), )); expect(find.byType(Text), findsOneWidget); @@ -397,8 +397,8 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: false, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsNothing); @@ -413,8 +413,8 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, visible: true, + child: testChild, ), )); expect(find.byType(Text), findsOneWidget); diff --git a/packages/flutter_driver/test/src/real_tests/extension_test.dart b/packages/flutter_driver/test/src/real_tests/extension_test.dart index 6857a2130f..9a1dd8f76d 100644 --- a/packages/flutter_driver/test/src/real_tests/extension_test.dart +++ b/packages/flutter_driver/test/src/real_tests/extension_test.dart @@ -937,9 +937,9 @@ void main() { const Text('Foo', key: ValueKey('Text1')), const Text('Bar', key: ValueKey('Text2')), TextButton( - child: const Text('Whatever'), key: const ValueKey('Button'), onPressed: () {}, + child: const Text('Whatever'), ), ], ), @@ -1043,9 +1043,9 @@ void main() { child: Column( children: [ TextButton( - child: const Text('Whatever'), key: const ValueKey('Button'), onPressed: stubCallback, + child: const Text('Whatever'), ), ], ), diff --git a/packages/flutter_test/lib/src/animation_sheet.dart b/packages/flutter_test/lib/src/animation_sheet.dart index e4454a18f0..00fecf5cde 100644 --- a/packages/flutter_test/lib/src/animation_sheet.dart +++ b/packages/flutter_test/lib/src/animation_sheet.dart @@ -138,9 +138,9 @@ class AnimationSheetBuilder { assert(child != null); return _AnimationSheetRecorder( key: key, - child: child, size: frameSize, handleRecorded: recording ? _recordedFrames.add : null, + child: child, ); } diff --git a/packages/flutter_test/test/accessibility_test.dart b/packages/flutter_test/test/accessibility_test.dart index b09404dd3a..9690dab116 100644 --- a/packages/flutter_test/test/accessibility_test.dart +++ b/packages/flutter_test/test/accessibility_test.dart @@ -525,9 +525,9 @@ void main() { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget(_boilerplate(Semantics( container: true, - child: const SizedBox(width: 10.0, height: 10.0), onTap: () { }, label: 'test', + child: const SizedBox(width: 10.0, height: 10.0), ))); final Evaluation result = await labeledTapTargetGuideline.evaluate(tester); expect(result.passed, true); @@ -537,9 +537,9 @@ void main() { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget(_boilerplate(Semantics( container: true, - child: const SizedBox(width: 10.0, height: 10.0), onLongPress: () { }, label: '', + child: const SizedBox(width: 10.0, height: 10.0), ))); final Evaluation result = await labeledTapTargetGuideline.evaluate(tester); expect(result.passed, false); @@ -550,9 +550,9 @@ void main() { final SemanticsHandle handle = tester.ensureSemantics(); await tester.pumpWidget(_boilerplate(Semantics( container: true, - child: const SizedBox(width: 10.0, height: 10.0), onTap: () { }, label: '', + child: const SizedBox(width: 10.0, height: 10.0), ))); final Evaluation result = await labeledTapTargetGuideline.evaluate(tester); expect(result.passed, false); diff --git a/packages/flutter_test/test/finders_test.dart b/packages/flutter_test/test/finders_test.dart index d0e023d295..657ee2b1b8 100644 --- a/packages/flutter_test/test/finders_test.dart +++ b/packages/flutter_test/test/finders_test.dart @@ -81,8 +81,8 @@ void main() { label: 'Add', button: true, child: const TextButton( - child: Text('+'), onPressed: null, + child: Text('+'), ), ), ));