From 716d2524626fdc634d211a87c16d8dc9dd11865e Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Thu, 23 Mar 2023 12:43:53 -0700 Subject: [PATCH] Remove prefer_const_constructors ignores (#123284) Remove prefer_const_constructors ignores --- .../flutter/test/material/expansion_tile_test.dart | 13 ++++++------- .../selectable_region_context_menu_test.dart | 7 +++---- .../test/widgets/selectable_region_test.dart | 14 ++++++-------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index 98e0631b33..85cc7207d9 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -329,18 +329,17 @@ void main() { const Key child0Key = Key('child0'); const Key child1Key = Key('child1'); - // TODO(goderbauer): Reevaluate the following ignores when https://github.com/dart-lang/sdk/issues/51800 is fixed. - await tester.pumpWidget(MaterialApp( // ignore: prefer_const_constructors - home: Material( // ignore: prefer_const_constructors - child: Center( // ignore: prefer_const_constructors - child: ExpansionTile( // ignore: prefer_const_constructors - title: const Text('title'), + await tester.pumpWidget(const MaterialApp( + home: Material( + child: Center( + child: ExpansionTile( + title: Text('title'), // Set the column's alignment to Alignment.centerRight to test CrossAxisAlignment // of children widgets. This helps distinguish the effect of expandedAlignment // and expandedCrossAxisAlignment later in the test. expandedAlignment: Alignment.centerRight, expandedCrossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ SizedBox(height: 100, width: 100, key: child0Key), SizedBox(height: 100, width: 80, key: child1Key), ], diff --git a/packages/flutter/test/widgets/selectable_region_context_menu_test.dart b/packages/flutter/test/widgets/selectable_region_context_menu_test.dart index 794ddd0023..994f522542 100644 --- a/packages/flutter/test/widgets/selectable_region_context_menu_test.dart +++ b/packages/flutter/test/widgets/selectable_region_context_menu_test.dart @@ -144,16 +144,15 @@ class RenderSelectionSpy extends RenderProxyBox @override SelectionGeometry get value => _value; - // TODO(goderbauer): Reevaluate the ignore when https://github.com/dart-lang/sdk/issues/51800 is fixed. - SelectionGeometry _value = SelectionGeometry( // ignore: prefer_const_constructors + SelectionGeometry _value = const SelectionGeometry( hasContent: true, status: SelectionStatus.uncollapsed, - startSelectionPoint: const SelectionPoint( + startSelectionPoint: SelectionPoint( localPosition: Offset.zero, lineHeight: 0.0, handleType: TextSelectionHandleType.left, ), - endSelectionPoint: const SelectionPoint( + endSelectionPoint: SelectionPoint( localPosition: Offset.zero, lineHeight: 0.0, handleType: TextSelectionHandleType.left, diff --git a/packages/flutter/test/widgets/selectable_region_test.dart b/packages/flutter/test/widgets/selectable_region_test.dart index 6fd9801b1a..3abe91a604 100644 --- a/packages/flutter/test/widgets/selectable_region_test.dart +++ b/packages/flutter/test/widgets/selectable_region_test.dart @@ -1983,16 +1983,15 @@ class RenderSelectionSpy extends RenderProxyBox @override SelectionGeometry get value => _value; - // TODO(goderbauer): Reevaluate the ignore when https://github.com/dart-lang/sdk/issues/51800 is fixed. - SelectionGeometry _value = SelectionGeometry( // ignore: prefer_const_constructors + SelectionGeometry _value = const SelectionGeometry( hasContent: true, status: SelectionStatus.uncollapsed, - startSelectionPoint: const SelectionPoint( + startSelectionPoint: SelectionPoint( localPosition: Offset.zero, lineHeight: 0.0, handleType: TextSelectionHandleType.left, ), - endSelectionPoint: const SelectionPoint( + endSelectionPoint: SelectionPoint( localPosition: Offset.zero, lineHeight: 0.0, handleType: TextSelectionHandleType.left, @@ -2073,16 +2072,15 @@ class RenderSelectAll extends RenderProxyBox @override SelectionGeometry get value => _value; - // TODO(goderbauer): Reevaluate the ignore when https://github.com/dart-lang/sdk/issues/51800 is fixed. - SelectionGeometry _value = SelectionGeometry( // ignore: prefer_const_constructors + SelectionGeometry _value = const SelectionGeometry( hasContent: true, status: SelectionStatus.uncollapsed, - startSelectionPoint: const SelectionPoint( + startSelectionPoint: SelectionPoint( localPosition: Offset.zero, lineHeight: 0.0, handleType: TextSelectionHandleType.left, ), - endSelectionPoint: const SelectionPoint( + endSelectionPoint: SelectionPoint( localPosition: Offset.zero, lineHeight: 0.0, handleType: TextSelectionHandleType.left,