From 6d5fc420b66874458d7a2abc170682be6bc79666 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Mon, 11 Oct 2021 21:23:02 -0700 Subject: [PATCH] Enable `sort_child_properties_last` lint (#91585) --- analysis_options.yaml | 2 +- .../lib/component1.dart | 16 +-- dev/manual_tests/lib/drag_and_drop.dart | 6 +- .../cupertino_context_menu.0.dart | 6 +- .../material/banner/material_banner.0.dart | 4 +- .../material/banner/material_banner.1.dart | 2 +- .../bottom_app_bar/bottom_app_bar.1.dart | 2 +- ...opdown_button.selected_item_builder.0.dart | 2 +- .../floating_action_button.0.dart | 2 +- .../navigation_rail.extended_animation.0.dart | 2 +- ...essenger_state.show_material_banner.0.dart | 2 +- .../api/lib/material/tooltip/tooltip.1.dart | 2 +- ...chrome.set_system_u_i_overlay_style.1.dart | 2 +- .../animated_switcher.0.dart | 2 +- .../lib/widgets/async/future_builder.0.dart | 2 +- .../lib/widgets/async/stream_builder.0.dart | 2 +- .../api/lib/widgets/basic/fitted_box.0.dart | 2 +- .../lib/widgets/basic/physical_shape.0.dart | 15 +- .../widgets/dismissible/dismissible.0.dart | 10 +- .../lib/widgets/drag_target/draggable.0.dart | 16 +-- .../widgets/image/image.frame_builder.0.dart | 2 +- .../implicit_animations/animated_slide.0.dart | 4 +- .../widgets/page_storage/page_storage.0.dart | 2 +- .../restorable_value.0.dart | 2 +- .../scrollbar/raw_scrollbar.shape.0.dart | 10 +- .../lib/src/cupertino/date_picker.dart | 24 ++-- packages/flutter/lib/src/material/banner.dart | 2 +- .../flutter/lib/src/material/dropdown.dart | 2 +- .../flutter/lib/src/material/stepper.dart | 2 +- .../flutter/test/cupertino/form_row_test.dart | 8 +- .../flutter/test/cupertino/picker_test.dart | 2 +- .../flutter/test/material/dropdown_test.dart | 3 +- .../test/material/expansion_tile_test.dart | 4 +- .../test/material/grid_title_test.dart | 10 +- .../test/material/popup_menu_test.dart | 4 +- .../test/material/reorderable_list_test.dart | 2 +- packages/flutter/test/material/tabs_test.dart | 4 +- .../rendering/object_paint_dispose_test.dart | 2 +- .../flutter/test/widgets/draggable_test.dart | 128 +++++++++--------- .../flutter/test/widgets/page_view_test.dart | 4 +- .../flutter/test/widgets/transform_test.dart | 16 +-- .../flutter/test/widgets/visibility_test.dart | 4 +- 42 files changed, 171 insertions(+), 169 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index e1e9658722..eb0155dc88 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -186,7 +186,7 @@ linter: - recursive_getters - sized_box_for_whitespace - slash_for_doc_comments - # - sort_child_properties_last # not yet tested + - sort_child_properties_last - sort_constructors_first # - sort_pub_dependencies # prevents separating pinned transitive dependencies - sort_unnamed_constructors_first diff --git a/dev/integration_tests/deferred_components_test/lib/component1.dart b/dev/integration_tests/deferred_components_test/lib/component1.dart index 3d6ffa59fa..aeca0a6838 100644 --- a/dev/integration_tests/deferred_components_test/lib/component1.dart +++ b/dev/integration_tests/deferred_components_test/lib/component1.dart @@ -16,14 +16,14 @@ class LogoScreen extends StatelessWidget { Widget build(BuildContext context) { print(_testSentinel); return Container( + padding: const EdgeInsets.all(25), + color: Colors.blue, child: Column( children: [ - const Text('DeferredWidget', key: Key('DeferredWidget')), - Image.asset('customassets/flutter_logo.png', key: const Key('DeferredImage')), - ] - ), - padding: const EdgeInsets.all(25), - color: Colors.blue, - ); - } + const Text('DeferredWidget', key: Key('DeferredWidget')), + Image.asset('customassets/flutter_logo.png', key: const Key('DeferredImage')), + ], + ), + ); + } } diff --git a/dev/manual_tests/lib/drag_and_drop.dart b/dev/manual_tests/lib/drag_and_drop.dart index 14dc71c725..944a746449 100644 --- a/dev/manual_tests/lib/drag_and_drop.dart +++ b/dev/manual_tests/lib/drag_and_drop.dart @@ -132,18 +132,18 @@ class ExampleDragSource extends StatelessWidget { if (heavy) { return LongPressDraggable( data: color, - child: contents, feedback: feedback, feedbackOffset: feedbackOffset, dragAnchorStrategy: dragAnchorStrategy, + child: contents, ); } else { return Draggable( data: color, - child: contents, feedback: feedback, feedbackOffset: feedbackOffset, dragAnchorStrategy: dragAnchorStrategy, + child: contents, ); } } @@ -208,10 +208,10 @@ class MovableBall extends StatelessWidget { if (position == ballPosition) { return Draggable( data: true, - child: ball, childWhenDragging: dashedBall, feedback: ball, maxSimultaneousDrags: 1, + child: ball, ); } else { return DragTarget( diff --git a/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart b/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart index 314069514e..ccd0d76edf 100644 --- a/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart +++ b/examples/api/lib/cupertino/context_menu/cupertino_context_menu.0.dart @@ -35,9 +35,6 @@ class MyStatelessWidget extends StatelessWidget { width: 100, height: 100, child: CupertinoContextMenu( - child: Container( - color: Colors.red, - ), actions: [ CupertinoContextMenuAction( child: const Text('Action one'), @@ -52,6 +49,9 @@ class MyStatelessWidget extends StatelessWidget { }, ), ], + child: Container( + color: Colors.red, + ), ), ), ), diff --git a/examples/api/lib/material/banner/material_banner.0.dart b/examples/api/lib/material/banner/material_banner.0.dart index 934d7f73f7..9ad83ac999 100644 --- a/examples/api/lib/material/banner/material_banner.0.dart +++ b/examples/api/lib/material/banner/material_banner.0.dart @@ -38,12 +38,12 @@ class MyStatelessWidget extends StatelessWidget { backgroundColor: Color(0xFFE0E0E0), actions: [ TextButton( - child: Text('OPEN'), onPressed: null, + child: Text('OPEN'), ), TextButton( - child: Text('DISMISS'), onPressed: null, + child: Text('DISMISS'), ), ], ), diff --git a/examples/api/lib/material/banner/material_banner.1.dart b/examples/api/lib/material/banner/material_banner.1.dart index fdfc513097..10cc4d0e98 100644 --- a/examples/api/lib/material/banner/material_banner.1.dart +++ b/examples/api/lib/material/banner/material_banner.1.dart @@ -42,8 +42,8 @@ class MyStatelessWidget extends StatelessWidget { backgroundColor: Colors.green, actions: [ TextButton( - child: Text('DISMISS'), onPressed: null, + child: Text('DISMISS'), ), ], ), diff --git a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart index 51312205a9..e72b9d023e 100644 --- a/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart +++ b/examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart @@ -97,8 +97,8 @@ class _BottomAppBarDemoState extends State { floatingActionButton: _showFab ? FloatingActionButton( onPressed: () {}, - child: const Icon(Icons.add), tooltip: 'Create', + child: const Icon(Icons.add), ) : null, floatingActionButtonLocation: _fabLocation, diff --git a/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart b/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart index a0175858f7..dbffe1db79 100644 --- a/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart +++ b/examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart @@ -50,8 +50,8 @@ class _MyStatefulWidgetState extends State { }, items: items.map((String item) { return DropdownMenuItem( - child: Text('Log $item'), value: item, + child: Text('Log $item'), ); }).toList(), ), diff --git a/examples/api/lib/material/floating_action_button/floating_action_button.0.dart b/examples/api/lib/material/floating_action_button/floating_action_button.0.dart index 77eefc2ae9..f287f9cb4c 100644 --- a/examples/api/lib/material/floating_action_button/floating_action_button.0.dart +++ b/examples/api/lib/material/floating_action_button/floating_action_button.0.dart @@ -36,8 +36,8 @@ class MyStatelessWidget extends StatelessWidget { onPressed: () { // Add your onPressed code here! }, - child: const Icon(Icons.navigation), backgroundColor: Colors.green, + child: const Icon(Icons.navigation), ), ); } diff --git a/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart b/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart index 38763c1414..2f7e8ab2b4 100644 --- a/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart +++ b/examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart @@ -105,8 +105,8 @@ class MyNavigationRailFab extends StatelessWidget { ), child: animation.value == 0 ? FloatingActionButton( - child: const Icon(Icons.add), onPressed: onPressed, + child: const Icon(Icons.add), ) : Align( alignment: AlignmentDirectional.centerStart, diff --git a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart index a5b0761da9..b93c79f4e4 100644 --- a/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart +++ b/examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart @@ -39,8 +39,8 @@ class MyStatelessWidget extends StatelessWidget { content: Text('This is a MaterialBanner'), actions: [ TextButton( - child: Text('DISMISS'), onPressed: null, + child: Text('DISMISS'), ), ], ), diff --git a/examples/api/lib/material/tooltip/tooltip.1.dart b/examples/api/lib/material/tooltip/tooltip.1.dart index 17fb1ce77f..abf3de0b81 100644 --- a/examples/api/lib/material/tooltip/tooltip.1.dart +++ b/examples/api/lib/material/tooltip/tooltip.1.dart @@ -34,7 +34,6 @@ class MyStatelessWidget extends StatelessWidget { Widget build(BuildContext context) { return Tooltip( message: 'I am a Tooltip', - child: const Text('Tap this text and hold down to show a tooltip.'), decoration: BoxDecoration( borderRadius: BorderRadius.circular(25), gradient: @@ -48,6 +47,7 @@ class MyStatelessWidget extends StatelessWidget { ), showDuration: const Duration(seconds: 2), waitDuration: const Duration(seconds: 1), + child: const Text('Tap this text and hold down to show a tooltip.'), ); } } diff --git a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart index 4904487b06..7e69959cb5 100644 --- a/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart +++ b/examples/api/lib/services/system_chrome/system_chrome.set_system_u_i_overlay_style.1.dart @@ -56,8 +56,8 @@ class _MyStatefulWidgetState extends State { value: _currentStyle, child: Center( child: ElevatedButton( - child: const Text('Change Color'), onPressed: _changeColor, + child: const Text('Change Color'), ), ), ); diff --git a/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart b/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart index 3cc7e00839..fb86565674 100644 --- a/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart +++ b/examples/api/lib/widgets/animated_switcher/animated_switcher.0.dart @@ -42,7 +42,7 @@ class _MyStatefulWidgetState extends State { AnimatedSwitcher( duration: const Duration(milliseconds: 500), transitionBuilder: (Widget child, Animation animation) { - return ScaleTransition(child: child, scale: animation); + return ScaleTransition(scale: animation, child: child); }, child: Text( '$_count', diff --git a/examples/api/lib/widgets/async/future_builder.0.dart b/examples/api/lib/widgets/async/future_builder.0.dart index ab6ea90887..20ff39576a 100644 --- a/examples/api/lib/widgets/async/future_builder.0.dart +++ b/examples/api/lib/widgets/async/future_builder.0.dart @@ -71,9 +71,9 @@ class _MyStatefulWidgetState extends State { } else { children = const [ SizedBox( - child: CircularProgressIndicator(), width: 60, height: 60, + child: CircularProgressIndicator(), ), Padding( padding: EdgeInsets.only(top: 16), diff --git a/examples/api/lib/widgets/async/stream_builder.0.dart b/examples/api/lib/widgets/async/stream_builder.0.dart index 8c7005a624..2ec59351fa 100644 --- a/examples/api/lib/widgets/async/stream_builder.0.dart +++ b/examples/api/lib/widgets/async/stream_builder.0.dart @@ -82,9 +82,9 @@ class _MyStatefulWidgetState extends State { case ConnectionState.waiting: children = const [ SizedBox( - child: CircularProgressIndicator(), width: 60, height: 60, + child: CircularProgressIndicator(), ), Padding( padding: EdgeInsets.only(top: 16), diff --git a/examples/api/lib/widgets/basic/fitted_box.0.dart b/examples/api/lib/widgets/basic/fitted_box.0.dart index a11747c132..60647ee344 100644 --- a/examples/api/lib/widgets/basic/fitted_box.0.dart +++ b/examples/api/lib/widgets/basic/fitted_box.0.dart @@ -37,9 +37,9 @@ class MyStatelessWidget extends StatelessWidget { width: 300, color: Colors.red, child: FittedBox( + fit: BoxFit.fill, child: Image.network( 'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'), - fit: BoxFit.fill, ), ); } diff --git a/examples/api/lib/widgets/basic/physical_shape.0.dart b/examples/api/lib/widgets/basic/physical_shape.0.dart index fa4533bfe7..28e07118ea 100644 --- a/examples/api/lib/widgets/basic/physical_shape.0.dart +++ b/examples/api/lib/widgets/basic/physical_shape.0.dart @@ -34,7 +34,15 @@ class MyStatelessWidget extends StatelessWidget { body: Center( child: PhysicalShape( elevation: 5.0, + clipper: ShapeBorderClipper( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + ), + color: Colors.orange, child: const SizedBox( + height: 200.0, + width: 200.0, child: Center( child: Text( 'Hello, World!', @@ -44,14 +52,7 @@ class MyStatelessWidget extends StatelessWidget { ), ), ), - height: 200.0, - width: 200.0, ), - clipper: ShapeBorderClipper( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - )), - color: Colors.orange, ), ), ); diff --git a/examples/api/lib/widgets/dismissible/dismissible.0.dart b/examples/api/lib/widgets/dismissible/dismissible.0.dart index fc8e3f546d..d2b07a1a6a 100644 --- a/examples/api/lib/widgets/dismissible/dismissible.0.dart +++ b/examples/api/lib/widgets/dismissible/dismissible.0.dart @@ -42,11 +42,6 @@ class _MyStatefulWidgetState extends State { padding: const EdgeInsets.symmetric(vertical: 16), itemBuilder: (BuildContext context, int index) { return Dismissible( - child: ListTile( - title: Text( - 'Item ${items[index]}', - ), - ), background: Container( color: Colors.green, ), @@ -56,6 +51,11 @@ class _MyStatefulWidgetState extends State { items.removeAt(index); }); }, + child: ListTile( + title: Text( + 'Item ${items[index]}', + ), + ), ); }, ); diff --git a/examples/api/lib/widgets/drag_target/draggable.0.dart b/examples/api/lib/widgets/drag_target/draggable.0.dart index de5812df7f..d09bfbe223 100644 --- a/examples/api/lib/widgets/drag_target/draggable.0.dart +++ b/examples/api/lib/widgets/drag_target/draggable.0.dart @@ -43,14 +43,6 @@ class _MyStatefulWidgetState extends State { Draggable( // Data is the value this Draggable stores. data: 10, - child: Container( - height: 100.0, - width: 100.0, - color: Colors.lightGreenAccent, - child: const Center( - child: Text('Draggable'), - ), - ), feedback: Container( color: Colors.deepOrange, height: 100, @@ -65,6 +57,14 @@ class _MyStatefulWidgetState extends State { child: Text('Child When Dragging'), ), ), + child: Container( + height: 100.0, + width: 100.0, + color: Colors.lightGreenAccent, + child: const Center( + child: Text('Draggable'), + ), + ), ), DragTarget( builder: ( diff --git a/examples/api/lib/widgets/image/image.frame_builder.0.dart b/examples/api/lib/widgets/image/image.frame_builder.0.dart index 6c183bea0a..57b299f77a 100644 --- a/examples/api/lib/widgets/image/image.frame_builder.0.dart +++ b/examples/api/lib/widgets/image/image.frame_builder.0.dart @@ -42,10 +42,10 @@ class MyStatelessWidget extends StatelessWidget { return child; } return AnimatedOpacity( - child: child, opacity: frame == null ? 0 : 1, duration: const Duration(seconds: 1), curve: Curves.easeOut, + child: child, ); }, ), diff --git a/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart b/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart index 1509822b10..93674847ab 100644 --- a/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart +++ b/examples/api/lib/widgets/implicit_animations/animated_slide.0.dart @@ -49,12 +49,12 @@ class _MyStatefulWidgetState extends State { mainAxisSize: MainAxisSize.min, children: [ ElevatedButton( - child: const Text('Slide up'), onPressed: _slideUp, + child: const Text('Slide up'), ), ElevatedButton( - child: const Text('Slide down'), onPressed: _slideDown, + child: const Text('Slide down'), ), Padding( padding: const EdgeInsets.all(50), diff --git a/examples/api/lib/widgets/page_storage/page_storage.0.dart b/examples/api/lib/widgets/page_storage/page_storage.0.dart index 5311646ee6..5bce2dfcdd 100644 --- a/examples/api/lib/widgets/page_storage/page_storage.0.dart +++ b/examples/api/lib/widgets/page_storage/page_storage.0.dart @@ -45,8 +45,8 @@ class _MyHomePageState extends State { title: const Text('Persistence Example'), ), body: PageStorage( - child: pages[currentTab], bucket: _bucket, + child: pages[currentTab], ), bottomNavigationBar: BottomNavigationBar( currentIndex: currentTab, diff --git a/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart b/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart index 55d39cd19a..ae1db295ba 100644 --- a/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart +++ b/examples/api/lib/widgets/restoration_properties/restorable_value.0.dart @@ -74,8 +74,8 @@ class _MyStatefulWidgetState extends State @override Widget build(BuildContext context) { return OutlinedButton( - child: Text('${_answer.value}'), onPressed: _incrementAnswer, + child: Text('${_answer.value}'), ); } } diff --git a/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart b/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart index 869c9f58e3..f6355694f3 100644 --- a/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart +++ b/examples/api/lib/widgets/scrollbar/raw_scrollbar.shape.0.dart @@ -29,16 +29,16 @@ class MyStatelessWidget extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: RawScrollbar( - child: ListView( - children: List.generate( - 100, (int index) => Text((index * index).toString())), - physics: const BouncingScrollPhysics(), - ), shape: const StadiumBorder( side: BorderSide(color: Colors.brown, width: 3.0)), thickness: 15.0, thumbColor: Colors.blue, isAlwaysShown: true, + child: ListView( + physics: const BouncingScrollPhysics(), + children: List.generate( + 100, (int index) => Text((index * index).toString())), + ), ), ); } diff --git a/packages/flutter/lib/src/cupertino/date_picker.dart b/packages/flutter/lib/src/cupertino/date_picker.dart index f5c1a36227..eaadaf8303 100644 --- a/packages/flutter/lib/src/cupertino/date_picker.dart +++ b/packages/flutter/lib/src/cupertino/date_picker.dart @@ -795,6 +795,8 @@ class _CupertinoDatePickerDateTimeState extends State { assert(debugIsFlipped == isHourRegionFlipped); }, + looping: true, + selectionOverlay: selectionOverlay, children: List.generate(24, (int index) { final int hour = isHourRegionFlipped ? (index + 12) % 24 : index; final int displayHour = widget.use24hFormat ? hour : (hour + 11) % 12 + 1; @@ -808,8 +810,6 @@ class _CupertinoDatePickerDateTimeState extends State { ), ); }), - looping: true, - selectionOverlay: selectionOverlay, ), ); } @@ -835,6 +835,8 @@ class _CupertinoDatePickerDateTimeState extends State { backgroundColor: widget.backgroundColor, squeeze: _kSqueeze, onSelectedItemChanged: _onSelectedItemChange, + looping: true, + selectionOverlay: selectionOverlay, children: List.generate(60 ~/ widget.minuteInterval, (int index) { final int minute = index * widget.minuteInterval; @@ -858,8 +860,6 @@ class _CupertinoDatePickerDateTimeState extends State { ), ); }), - looping: true, - selectionOverlay: selectionOverlay, ), ); } @@ -889,6 +889,7 @@ class _CupertinoDatePickerDateTimeState extends State { assert(selectedAmPm == 0 || selectedAmPm == 1); _onSelectedItemChange(index); }, + selectionOverlay: selectionOverlay, children: List.generate(2, (int index) { return itemPositioningBuilder( context, @@ -900,7 +901,6 @@ class _CupertinoDatePickerDateTimeState extends State { ), ); }), - selectionOverlay: selectionOverlay, ), ); } @@ -1172,6 +1172,8 @@ class _CupertinoDatePickerDateState extends State { if (_isCurrentDateValid) widget.onDateTimeChanged(DateTime(selectedYear, selectedMonth, selectedDay)); }, + looping: true, + selectionOverlay: selectionOverlay, children: List.generate(31, (int index) { final int day = index + 1; return itemPositioningBuilder( @@ -1182,8 +1184,6 @@ class _CupertinoDatePickerDateState extends State { ), ); }), - looping: true, - selectionOverlay: selectionOverlay, ), ); } @@ -1213,6 +1213,8 @@ class _CupertinoDatePickerDateState extends State { if (_isCurrentDateValid) widget.onDateTimeChanged(DateTime(selectedYear, selectedMonth, selectedDay)); }, + looping: true, + selectionOverlay: selectionOverlay, children: List.generate(12, (int index) { final int month = index + 1; final bool isInvalidMonth = (widget.minimumDate?.year == selectedYear && widget.minimumDate!.month > month) @@ -1226,8 +1228,6 @@ class _CupertinoDatePickerDateState extends State { ), ); }), - looping: true, - selectionOverlay: selectionOverlay, ), ); } @@ -1782,6 +1782,7 @@ class _CupertinoTimerPickerState extends State { ); }); }, + selectionOverlay: selectionOverlay, children: List.generate(24, (int index) { final String label = localizations.timerPickerHourLabel(index) ?? ''; final String semanticsLabel = textDirectionFactor == 1 @@ -1794,7 +1795,6 @@ class _CupertinoTimerPickerState extends State { child: _buildPickerNumberLabel(localizations.timerPickerHour(index), additionalPadding), ); }), - selectionOverlay: selectionOverlay, ); } @@ -1847,6 +1847,7 @@ class _CupertinoTimerPickerState extends State { ); }); }, + selectionOverlay: selectionOverlay, children: List.generate(60 ~/ widget.minuteInterval, (int index) { final int minute = index * widget.minuteInterval; final String label = localizations.timerPickerMinuteLabel(minute) ?? ''; @@ -1860,7 +1861,6 @@ class _CupertinoTimerPickerState extends State { child: _buildPickerNumberLabel(localizations.timerPickerMinute(minute), additionalPadding), ); }), - selectionOverlay: selectionOverlay, ); } @@ -1913,6 +1913,7 @@ class _CupertinoTimerPickerState extends State { ); }); }, + selectionOverlay: selectionOverlay, children: List.generate(60 ~/ widget.secondInterval, (int index) { final int second = index * widget.secondInterval; final String label = localizations.timerPickerSecondLabel(second) ?? ''; @@ -1926,7 +1927,6 @@ class _CupertinoTimerPickerState extends State { child: _buildPickerNumberLabel(localizations.timerPickerSecond(second), additionalPadding), ); }), - selectionOverlay: selectionOverlay, ); } diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index c2214dbd38..3bbbebf9ab 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -381,8 +381,8 @@ class _MaterialBannerState extends State { } return Hero( - child: ClipRect(child: materialBannerTransition), tag: '', + child: ClipRect(child: materialBannerTransition), ); } } diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index b26a5257da..53bdb32e4b 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -195,8 +195,8 @@ class _DropdownMenuItemButtonState extends State<_DropdownMenuItemButton> enableFeedback: widget.enableFeedback, onTap: _handleOnTap, onFocusChange: _handleFocusChange, - child: child, borderRadius: itemBorderRadius, + child: child, ); } child = FadeTransition(opacity: opacity, child: child); diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart index 134bfdcf1b..925c103f4f 100755 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -759,7 +759,7 @@ class _StepperState extends State with TickerProviderStateMixin { AnimatedSize( curve: Curves.fastOutSlowIn, duration: kThemeAnimationDuration, - child: Column(children: stepPanels, crossAxisAlignment: CrossAxisAlignment.stretch), + child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: stepPanels), ), _buildVerticalControls(widget.currentStep), ], diff --git a/packages/flutter/test/cupertino/form_row_test.dart b/packages/flutter/test/cupertino/form_row_test.dart index d9b2e6df0b..eff039fc7d 100644 --- a/packages/flutter/test/cupertino/form_row_test.dart +++ b/packages/flutter/test/cupertino/form_row_test.dart @@ -88,8 +88,8 @@ void main() { const CupertinoApp( home: Center( child: CupertinoFormRow( - child: CupertinoTextField(), error: error, + child: CupertinoTextField(), ), ), ), @@ -105,8 +105,8 @@ void main() { const CupertinoApp( home: Center( child: CupertinoFormRow( - child: CupertinoTextField(), helper: helper, + child: CupertinoTextField(), ), ), ), @@ -123,9 +123,9 @@ void main() { const CupertinoApp( home: Center( child: CupertinoFormRow( - child: CupertinoTextField(), helper: helper, error: error, + child: CupertinoTextField(), ), ), ), @@ -145,9 +145,9 @@ void main() { const CupertinoApp( home: Center( child: CupertinoFormRow( - child: CupertinoTextField(), helper: helper, error: error, + child: CupertinoTextField(), ), ), ), diff --git a/packages/flutter/test/cupertino/picker_test.dart b/packages/flutter/test/cupertino/picker_test.dart index e94f711353..f0217500e0 100644 --- a/packages/flutter/test/cupertino/picker_test.dart +++ b/packages/flutter/test/cupertino/picker_test.dart @@ -182,9 +182,9 @@ void main() { width: 300.0, child: CupertinoPicker( itemExtent: 15.0, - children: const [Text('1'), Text('1')], onSelectedItemChanged: (int i) {}, selectionOverlay: const CupertinoPickerDefaultSelectionOverlay(background: Color(0x12345678)), + children: const [Text('1'), Text('1')], ), ), ), diff --git a/packages/flutter/test/material/dropdown_test.dart b/packages/flutter/test/material/dropdown_test.dart index 3a8ba4c544..29ef908601 100644 --- a/packages/flutter/test/material/dropdown_test.dart +++ b/packages/flutter/test/material/dropdown_test.dart @@ -3536,7 +3536,8 @@ void main() { value: 'One', items: const >[ DropdownMenuItem( - child: Text('One'), value: 'One' + value: 'One', + child: Text('One') ), ], onChanged: (_) { }, diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index 68ec473f43..a6ae70eb3e 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -175,13 +175,13 @@ void main() { initiallyExpanded: true, title: TestText('Expanded', key: expandedTitleKey), backgroundColor: Colors.red, - children: const [ListTile(title: Text('0'))], trailing: TestIcon(key: expandedIconKey), + children: const [ListTile(title: Text('0'))], ), ExpansionTile( title: TestText('Collapsed', key: collapsedTitleKey), - children: const [ListTile(title: Text('0'))], trailing: TestIcon(key: collapsedIconKey), + children: const [ListTile(title: Text('0'))], ), ], ), diff --git a/packages/flutter/test/material/grid_title_test.dart b/packages/flutter/test/material/grid_title_test.dart index 7cee24b7ed..b3f1f1c856 100644 --- a/packages/flutter/test/material/grid_title_test.dart +++ b/packages/flutter/test/material/grid_title_test.dart @@ -19,16 +19,16 @@ void main() { subtitle: const Text('Subtitle'), trailing: const Icon(Icons.thumb_up), ), - child: DecoratedBox( - decoration: BoxDecoration( - color: Colors.green[500], - ), - ), footer: GridTileBar( key: footerKey, title: const Text('Footer'), backgroundColor: Colors.black38, ), + child: DecoratedBox( + decoration: BoxDecoration( + color: Colors.green[500], + ), + ), ), )); diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index f2a1b1a513..1be98e7831 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -556,9 +556,9 @@ void main() { testWidgets('PopupMenuButton fails when given both child and icon', (WidgetTester tester) async { expect(() { PopupMenuButton( - child: const Text('heyo'), icon: const Icon(Icons.view_carousel), itemBuilder: simplePopupMenuItemBuilder, + child: const Text('heyo'), ); }, throwsAssertionError); }); @@ -1699,8 +1699,8 @@ void main() { expect(() { PopupMenuButton( itemBuilder: (BuildContext context) => >[], - child: Container(), icon: const Icon(Icons.error), + child: Container(), ); }, throwsAssertionError); }); diff --git a/packages/flutter/test/material/reorderable_list_test.dart b/packages/flutter/test/material/reorderable_list_test.dart index 34ce29cd0c..e8caf8ee74 100644 --- a/packages/flutter/test/material/reorderable_list_test.dart +++ b/packages/flutter/test/material/reorderable_list_test.dart @@ -1520,10 +1520,10 @@ void main() { testWidgets('ReorderableListView asserts on both non-null itemExtent and prototypeItem', (WidgetTester tester) async { expect(() => ReorderableListView( - children: const [], itemExtent: 30, prototypeItem: const SizedBox(), onReorder: (int fromIndex, int toIndex) { }, + children: const [], ), throwsAssertionError); }); diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart index 374f5e5496..be68626dde 100644 --- a/packages/flutter/test/material/tabs_test.dart +++ b/packages/flutter/test/material/tabs_test.dart @@ -3789,12 +3789,12 @@ void main() { tabs: [ Tab( icon: Icon(Icons.check,size: 40), - child: Text('1 - OK',style: TextStyle(fontSize: 25),), height: 85, + child: Text('1 - OK',style: TextStyle(fontSize: 25),), ), // icon and child Tab( - child: Text('2 - OK',style: TextStyle(fontSize: 25),), height: 85, + child: Text('2 - OK',style: TextStyle(fontSize: 25),), ), // child Tab( icon: Icon(Icons.done,size: 40), diff --git a/packages/flutter/test/rendering/object_paint_dispose_test.dart b/packages/flutter/test/rendering/object_paint_dispose_test.dart index e689d58175..2f0f777a50 100644 --- a/packages/flutter/test/rendering/object_paint_dispose_test.dart +++ b/packages/flutter/test/rendering/object_paint_dispose_test.dart @@ -16,8 +16,8 @@ void main() { child: CustomPaint( key: key, painter: SimplePainter(), - child: const RepaintBoundary(child: Placeholder()), foregroundPainter: SimplePainter(), + child: const RepaintBoundary(child: Placeholder()), ), )); diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart index 7e190f224c..a85dd934f8 100644 --- a/packages/flutter/test/widgets/draggable_test.dart +++ b/packages/flutter/test/widgets/draggable_test.dart @@ -28,11 +28,11 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragStarted: () { ++dragStartedCount; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -103,8 +103,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -178,8 +178,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -254,8 +254,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -327,8 +327,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -402,8 +402,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), Stack( children: [ @@ -495,6 +495,7 @@ void main() { children: [ Draggable( data: 1, + feedback: const Text('Dragging'), child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { @@ -502,7 +503,6 @@ void main() { }, child: const Text('Button'), ), - feedback: const Text('Dragging'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -552,8 +552,8 @@ void main() { children: [ const LongPressDraggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -601,8 +601,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -665,15 +665,15 @@ void main() { Container(height: 400.0), const Draggable( data: 1, - child: Text('H'), feedback: Text('Dragging'), affinity: Axis.horizontal, + child: Text('H'), ), const Draggable( data: 2, - child: Text('V'), feedback: Text('Dragging'), affinity: Axis.vertical, + child: Text('V'), ), Container(height: 500.0), Container(height: 500.0), @@ -776,15 +776,15 @@ void main() { Container(width: 400.0), const Draggable( data: 1, - child: Text('H'), feedback: Text('Dragging'), affinity: Axis.horizontal, + child: Text('H'), ), const Draggable( data: 2, - child: Text('V'), feedback: Text('Dragging'), affinity: Axis.vertical, + child: Text('V'), ), Container(width: 500.0), Container(width: 500.0), @@ -886,23 +886,23 @@ void main() { Container(width: 400.0), const Draggable( data: 1, - child: Text('H'), feedback: Text('H'), childWhenDragging: SizedBox(), axis: Axis.horizontal, + child: Text('H'), ), const Draggable( data: 2, - child: Text('V'), feedback: Text('V'), childWhenDragging: SizedBox(), axis: Axis.vertical, + child: Text('V'), ), const Draggable( data: 3, - child: Text('N'), feedback: Text('N'), childWhenDragging: SizedBox(), + child: Text('N'), ), Container(width: 500.0), Container(width: 500.0), @@ -1009,32 +1009,32 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragUpdate: (DragUpdateDetails details) { dragDelta += details.delta; updated++; }, + child: const Text('Source'), ), Draggable( data: 2, - child: const Text('Vertical Source'), feedback: const Text('Vertical Dragging'), onDragUpdate: (DragUpdateDetails details) { dragDelta += details.delta; updated++; }, axis: Axis.vertical, + child: const Text('Vertical Source'), ), Draggable( data: 3, - child: const Text('Horizontal Source'), feedback: const Text('Horizontal Dragging'), onDragUpdate: (DragUpdateDetails details) { dragDelta += details.delta; updated++; }, axis: Axis.horizontal, + child: const Text('Horizontal Source'), ), ], ), @@ -1157,11 +1157,11 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDraggableCanceled: (Velocity velocity, Offset offset) { onDraggableCanceledCalled = true; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1227,13 +1227,13 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDraggableCanceled: (Velocity velocity, Offset offset) { onDraggableCanceledCalled = true; onDraggableCanceledVelocity = velocity; onDraggableCanceledOffset = offset; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1303,13 +1303,13 @@ void main() { home: Column(children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Source'), onDraggableCanceled: (Velocity velocity, Offset offset) { onDraggableCanceledCalled = true; onDraggableCanceledVelocity = velocity; onDraggableCanceledOffset = offset; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1354,12 +1354,12 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragEnd: (DraggableDetails details) { onDragEndCalled = true; onDragEndDraggableDetails = details; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1426,8 +1426,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1481,11 +1481,11 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDraggableCanceled: (Velocity velocity, Offset offset) { numberOfTimesOnDraggableCanceledCalled++; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1566,11 +1566,11 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragCompleted: () { onDragCompletedCalled = true; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1637,12 +1637,12 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragEnd: (DraggableDetails details) { onDragEndCalled = true; onDragEndDraggableDetails = details; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1712,11 +1712,11 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragEnd: (DraggableDetails details) { timesOnDragEndCalled++; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1756,8 +1756,8 @@ void main() { children: const [ Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), ], ), @@ -1779,11 +1779,11 @@ void main() { children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragCompleted: () { onDragCompletedCalled = true; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -1848,13 +1848,13 @@ void main() { children: [ const Draggable( data: 1, - child: Text('IntSource'), feedback: Text('IntDragging'), + child: Text('IntSource'), ), const Draggable( data: 1.0, - child: Text('DoubleSource'), feedback: Text('DoubleDragging'), + child: Text('DoubleSource'), ), Stack( children: [ @@ -1982,8 +1982,8 @@ void main() { children: [ Draggable( data: dragTargetData, - child: const Text('Source'), feedback: const Text('Dragging'), + child: const Text('Source'), ), Stack( children: [ @@ -2050,8 +2050,8 @@ void main() { Draggable( data: 1, maxSimultaneousDrags: maxSimultaneousDrags, - child: const Text('Source'), feedback: const Text('Dragging'), + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -2179,14 +2179,14 @@ void main() { didTap = true; }, child: Draggable( - child: Container( - color: const Color(0xFFFFFF00), - ), feedback: Container( width: 100.0, height: 100.0, color: const Color(0xFFFF0000), ), + child: Container( + color: const Color(0xFFFFFF00), + ), ), ), ), @@ -2215,14 +2215,14 @@ void main() { builder: (BuildContext context) => GestureDetector( onTap: () { /* registers a tap recognizer */ }, child: Draggable( - child: Container( - color: const Color(0xFFFFFF00), - ), feedback: Container( width: 100.0, height: 100.0, color: const Color(0xFFFF0000), ), + child: Container( + color: const Color(0xFFFFFF00), + ), ), ), ), @@ -2247,8 +2247,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -2288,8 +2288,8 @@ void main() { children: const [ Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), ], ), @@ -2309,8 +2309,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -2415,12 +2415,12 @@ void main() { children: [ LongPressDraggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragEnd: (DraggableDetails details) { onDragEndCalled = true; onDragEndDraggableDetails = details; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -2501,11 +2501,11 @@ void main() { children: [ LongPressDraggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragCompleted: () { onDragCompletedCalled = true; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -2573,11 +2573,11 @@ void main() { await tester.pumpWidget(MaterialApp( home: LongPressDraggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragStarted: () { onDragStartedCalled = true; }, + child: const Text('Source'), ), )); @@ -2606,11 +2606,11 @@ void main() { home: LongPressDraggable( data: 1, delay: const Duration(seconds: 2), - child: const Text('Source'), feedback: const Text('Dragging'), onDragStarted: () { onDragStartedCalled = true; }, + child: const Text('Source'), ), )); expect(find.text('Source'), findsOneWidget); @@ -2639,11 +2639,11 @@ void main() { await tester.pumpWidget(MaterialApp( home: LongPressDraggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragStarted: () { onDragStartedCalled = true; }, + child: const Text('Source'), ), )); expect(find.text('Source'), findsOneWidget); @@ -2702,9 +2702,9 @@ void main() { settings: settings, builder: (BuildContext context) => const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), rootOverlay: true, + child: Text('Source'), ), ); } @@ -2758,8 +2758,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -2794,8 +2794,8 @@ void main() { children: [ const Draggable( data: 1, - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -2830,8 +2830,8 @@ void main() { home: Column( children: [ const Draggable( - child: Text('Source'), feedback: Text('Dragging'), + child: Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { @@ -2880,25 +2880,25 @@ void main() { Container(width: 400.0), const Draggable( data: 1, - child: Text('H'), feedback: Text('H'), childWhenDragging: SizedBox(), axis: Axis.horizontal, ignoringFeedbackSemantics: false, + child: Text('H'), ), const Draggable( data: 2, - child: Text('V'), feedback: Text('V'), childWhenDragging: SizedBox(), axis: Axis.vertical, ignoringFeedbackSemantics: false, + child: Text('V'), ), const Draggable( data: 3, - child: Text('N'), feedback: Text('N'), childWhenDragging: SizedBox(), + child: Text('N'), ), ], ), @@ -3038,12 +3038,12 @@ void main() { home: Column( children: [ Draggable( - child: const Text('Source'), feedback: const Text('Feedback'), dragAnchorStrategy: (Draggable widget, BuildContext context, Offset position) { dragAnchorStrategyCalled = true; return Offset.zero; }, + child: const Text('Source'), ), ], ), @@ -3099,12 +3099,12 @@ void main() { const Widget widget1 = Placeholder(key: ValueKey(1)); const Widget widget2 = Placeholder(key: ValueKey(2)); Offset dummyStrategy(Draggable draggable, BuildContext context, Offset position) => Offset.zero; - expect(const LongPressDraggable(child: widget1, feedback: widget2), isA>()); - expect(const LongPressDraggable(child: widget1, feedback: widget2).child, widget1); - expect(const LongPressDraggable(child: widget1, feedback: widget2).feedback, widget2); - expect(const LongPressDraggable(child: widget1, feedback: widget2).dragAnchor, DragAnchor.child); - expect(const LongPressDraggable(child: widget1, feedback: widget2, dragAnchor: DragAnchor.pointer).dragAnchor, DragAnchor.pointer); - expect(LongPressDraggable(child: widget1, feedback: widget2, dragAnchorStrategy: dummyStrategy).dragAnchorStrategy, dummyStrategy); + expect(const LongPressDraggable(feedback: widget2, child: widget1), isA>()); + expect(const LongPressDraggable(feedback: widget2, child: widget1).child, widget1); + expect(const LongPressDraggable(feedback: widget2, child: widget1).feedback, widget2); + expect(const LongPressDraggable(feedback: widget2, child: widget1).dragAnchor, DragAnchor.child); + expect(const LongPressDraggable(feedback: widget2, dragAnchor: DragAnchor.pointer, child: widget1).dragAnchor, DragAnchor.pointer); + expect(LongPressDraggable(feedback: widget2, dragAnchorStrategy: dummyStrategy, child: widget1).dragAnchorStrategy, dummyStrategy); }); } @@ -3121,12 +3121,12 @@ Future _testLongPressDraggableHapticFeedback({ required WidgetTester teste await tester.pumpWidget(MaterialApp( home: LongPressDraggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), hapticFeedbackOnStart: hapticFeedbackOnStart, onDragStarted: () { onDragStartedCalled = true; }, + child: const Text('Source'), ), )); @@ -3169,11 +3169,11 @@ Future _testChildAnchorFeedbackPosition({ required WidgetTester tester, do children: [ Draggable( data: 1, - child: const Text('Source'), feedback: const Text('Dragging'), onDragStarted: () { ++dragStartedCount; }, + child: const Text('Source'), ), DragTarget( builder: (BuildContext context, List data, List rejects) { diff --git a/packages/flutter/test/widgets/page_view_test.dart b/packages/flutter/test/widgets/page_view_test.dart index 7ac4b1f1f2..7a47333f2b 100644 --- a/packages/flutter/test/widgets/page_view_test.dart +++ b/packages/flutter/test/widgets/page_view_test.dart @@ -25,9 +25,9 @@ void main() { child: SizedBox.fromSize( size: size, child: PageView( - children: kStates.map((String state) => Text(state)).toList(), controller: controller, onPageChanged: (int page) { }, + children: kStates.map((String state) => Text(state)).toList(), ), ), ), @@ -70,9 +70,9 @@ void main() { child: SizedBox.fromSize( size: size, child: PageView( - children: kStates.map((String state) => Text(state)).toList(), controller: controller, onPageChanged: (int page) { }, + children: kStates.map((String state) => Text(state)).toList(), ), ), ), diff --git a/packages/flutter/test/widgets/transform_test.dart b/packages/flutter/test/widgets/transform_test.dart index 76265b3292..aa0027fc09 100644 --- a/packages/flutter/test/widgets/transform_test.dart +++ b/packages/flutter/test/widgets/transform_test.dart @@ -397,8 +397,8 @@ void main() { await tester.pumpWidget( Transform.translate( offset: const Offset(25.0, 25.0), - child: const SizedBox(width: 100, height: 100), filterQuality: FilterQuality.low, + child: const SizedBox(width: 100, height: 100), ), ); expect(tester.layers.whereType().length, 1); @@ -408,8 +408,8 @@ void main() { await tester.pumpWidget( Transform.scale( scale: 3.14159, - child: const SizedBox(width: 100, height: 100), filterQuality: FilterQuality.low, + child: const SizedBox(width: 100, height: 100), ), ); expect(tester.layers.whereType().length, 1); @@ -419,8 +419,8 @@ void main() { await tester.pumpWidget( Transform.rotate( angle: math.pi / 4, - child: const SizedBox(width: 100, height: 100), filterQuality: FilterQuality.low, + child: const SizedBox(width: 100, height: 100), ), ); expect(tester.layers.whereType().length, 1); @@ -430,8 +430,8 @@ void main() { await tester.pumpWidget( Transform.rotate( angle: math.pi / 4, - child: const SizedBox(width: 100, height: 100), filterQuality: FilterQuality.low, + child: const SizedBox(width: 100, height: 100), ), ); expect(tester.layers.whereType(), hasLength(1)); @@ -455,8 +455,8 @@ void main() { await tester.pumpWidget( Transform.rotate( angle: math.pi / 4, - child: const SizedBox(width: 100, height: 100), filterQuality: FilterQuality.low, + child: const SizedBox(width: 100, height: 100), ), ); expect(tester.layers.whereType(), hasLength(1)); @@ -483,18 +483,18 @@ void main() { ), Transform.rotate( angle: math.pi / 6, - child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))), filterQuality: FilterQuality.low, + child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))), ), Transform.scale( scale: 1.5, - child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))), filterQuality: FilterQuality.low, + child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))), ), Transform.translate( offset: const Offset(20.0, 60.0), - child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))), filterQuality: FilterQuality.low, + child: Center(child: Container(width: 100, height: 20, color: const Color(0xff00ff00))), ), ], ), diff --git a/packages/flutter/test/widgets/visibility_test.dart b/packages/flutter/test/widgets/visibility_test.dart index 342481961a..1809a0a958 100644 --- a/packages/flutter/test/widgets/visibility_test.dart +++ b/packages/flutter/test/widgets/visibility_test.dart @@ -106,9 +106,9 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, replacement: const Placeholder(), visible: false, + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsNothing); @@ -123,8 +123,8 @@ void main() { await tester.pumpWidget(Center( child: Visibility( - child: testChild, replacement: const Placeholder(), + child: testChild, ), )); expect(find.byType(Text, skipOffstage: false), findsOneWidget);