Unverified Commit c4fda233 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Remove outdated ignores from framework (#140465)

These were not ignoring anything (anymore).
parent e2e8bcb1
......@@ -3,7 +3,6 @@
// found in the LICENSE file.
// we ignore these so that the format of the strings below matches what package:test prints, to make maintenance easier
// ignore_for_file: avoid_escaping_inner_quotes
// ignore_for_file: use_raw_strings
import 'dart:io';
......
......@@ -68,8 +68,6 @@ class _SelectionControlsPageState extends State<SelectionControlsPage> {
const Checkbox(
key: checkbox2Key,
value: false,
// TODO(scheglov): Requires linter fix, https://github.com/dart-lang/sdk/issues/49596.
// ignore: avoid_redundant_argument_values
onChanged: null,
),
],
......
......@@ -2,11 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This library intentionally uses the LinkedHashMap constructor to declare that
// entries will be ordered. Using collection literals for this requires casting the
// resulting map, which has a runtime cost.
// ignore_for_file: prefer_collection_literals
import 'dart:collection' show LinkedHashMap;
import 'dart:ui';
......
......@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore: deprecated_member_use
import 'dart:ui' as ui show AccessibilityFeatures, SemanticsActionEvent, SemanticsUpdateBuilder;
import 'package:flutter/foundation.dart';
......@@ -10,7 +9,6 @@ import 'package:flutter/services.dart';
import 'debug.dart';
// ignore: deprecated_member_use
export 'dart:ui' show AccessibilityFeatures, SemanticsActionEvent, SemanticsUpdateBuilder;
/// The glue between the semantics layer and the Flutter engine.
......
......@@ -3,7 +3,6 @@
// found in the LICENSE file.
import 'dart:math' as math;
// ignore: deprecated_member_use
import 'dart:ui' show Offset, Rect, SemanticsAction, SemanticsFlag, SemanticsUpdate, SemanticsUpdateBuilder, StringAttribute, TextDirection;
import 'package:collection/collection.dart';
......
......@@ -4,7 +4,6 @@
import 'binding.dart';
// ignore: avoid_classes_with_only_static_members
/// Stand-in for non-web platforms' [BackgroundIsolateBinaryMessenger].
class BackgroundIsolateBinaryMessenger {
/// Throws an [UnsupportedError].
......
......@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// ignore_for_file: prefer_const_constructors_in_immutables
// ignore_for_file: avoid_unused_constructor_parameters
import 'framework.dart';
import 'platform_view.dart';
......
......@@ -94,7 +94,7 @@ abstract class StreamBuilderBase<T, S> extends StatefulWidget {
/// State for [StreamBuilderBase].
class _StreamBuilderBaseState<T, S> extends State<StreamBuilderBase<T, S>> {
StreamSubscription<T>? _subscription; // ignore: cancel_subscriptions
StreamSubscription<T>? _subscription;
late S _summary;
@override
......
......@@ -21,11 +21,6 @@ import 'framework.dart';
/// than [Widget] as the type of their `child` property.
///
/// Use [PreferredSize] to give a preferred size to an arbitrary widget.
// (We ignore `avoid_implementing_value_types` here because the superclass
// doesn't really implement `operator ==`, it just overrides it to _prevent_ it
// from being implemented, which is the exact opposite of the spirit of the
// `avoid_implementing_value_types` lint.)
// ignore: avoid_implementing_value_types
abstract class PreferredSizeWidget implements Widget {
/// The size this widget would prefer if it were otherwise unconstrained.
///
......
......@@ -3380,7 +3380,7 @@ class _Location {
required this.file,
required this.line,
required this.column,
// ignore: unused_element, unused_element_parameter
// ignore: unused_element
this.name,
});
......
......@@ -61,28 +61,20 @@ int getChildCount(WidgetTester tester) {
}
ui.RRect getSurroundingRect(WidgetTester tester, {int child = 0}) {
// Using dynamic so the test can access private classes.
// ignore: avoid_dynamic_calls
return ((getRenderSegmentedControl(tester) as RenderBoxContainerDefaultsMixin<RenderBox, ContainerBoxParentData<RenderBox>>)
.getChildrenAsList()[child].parentData! as dynamic).surroundingRect as ui.RRect;
}
Size getChildSize(WidgetTester tester, {int child = 0}) {
// Using dynamic so the test can access private classes.
// ignore: avoid_dynamic_calls
return (getRenderSegmentedControl(tester) as RenderBoxContainerDefaultsMixin<RenderBox, ContainerBoxParentData<RenderBox>>)
.getChildrenAsList()[child].size;
}
Color getBorderColor(WidgetTester tester) {
// Using dynamic so the test can access a private class.
// ignore: avoid_dynamic_calls
return (getRenderSegmentedControl(tester) as dynamic).borderColor as Color;
}
int? getSelectedIndex(WidgetTester tester) {
// Using dynamic so the test can access a private class.
// ignore: avoid_dynamic_calls
return (getRenderSegmentedControl(tester) as dynamic).selectedIndex as int?;
}
......
......@@ -34,20 +34,14 @@ Rect currentUnscaledThumbRect(WidgetTester tester, { bool useGlobalCoordinate =
}
int? getHighlightedIndex(WidgetTester tester) {
// Using dynamic to access private class in test.
// ignore: avoid_dynamic_calls
return (getRenderSegmentedControl(tester) as dynamic).highlightedIndex as int?;
}
Color getThumbColor(WidgetTester tester) {
// Using dynamic to access private class in test.
// ignore: avoid_dynamic_calls
return (getRenderSegmentedControl(tester) as dynamic).thumbColor as Color;
}
double currentThumbScale(WidgetTester tester) {
// Using dynamic to access private class in test.
// ignore: avoid_dynamic_calls
return (getRenderSegmentedControl(tester) as dynamic).thumbScale as double;
}
......
......@@ -490,7 +490,6 @@ void main() {
await gesture.up();
await tester.pump();
expect(value, isFalse);
// ignore: avoid_dynamic_calls
final CurvedAnimation position = (tester.state(find.byType(CupertinoSwitch)) as dynamic).position as CurvedAnimation;
expect(position.value, lessThan(0.5));
await tester.pump();
......
......@@ -40,7 +40,7 @@ void main() {
Object? exception;
try {
await future.whenComplete(() { // ignore: void_checks, https://github.com/dart-lang/linter/issues/1675
await future.whenComplete(() {
throw ArgumentError();
});
// Unreached.
......
......@@ -1429,7 +1429,7 @@ void main() {
await tester.pump(const Duration(seconds: 2));
final Finder finder = find.byWidgetPredicate((Widget widget) => widget.runtimeType.toString() == '_PackagesView');
// force the stream to complete (has to be done in a runAsync block since it's areal async process)
await tester.runAsync(() => (tester.firstState(finder) as dynamic).licenses as Future<dynamic>); // ignore: avoid_dynamic_calls
await tester.runAsync(() => (tester.firstState(finder) as dynamic).licenses as Future<dynamic>);
expect(tester.takeException().toString(), 'Exception: Injected failure');
await tester.pumpAndSettle();
expect(tester.takeException().toString(), 'Exception: Injected failure');
......@@ -1452,7 +1452,7 @@ void main() {
await tester.pump(const Duration(seconds: 2));
final Finder finder = find.byWidgetPredicate((Widget widget) => widget.runtimeType.toString() == '_PackagesView');
// force the stream to complete (has to be done in a runAsync block since it's areal async process)
await tester.runAsync(() => (tester.firstState(finder) as dynamic).licenses as Future<dynamic>); // ignore: avoid_dynamic_calls
await tester.runAsync(() => (tester.firstState(finder) as dynamic).licenses as Future<dynamic>);
expect(tester.takeException().toString(), 'Exception: Injected failure');
await tester.pumpAndSettle();
expect(tester.takeException().toString(), 'Exception: Injected failure');
......
......@@ -52,12 +52,10 @@ void main() {
final MaterialInkController material = Material.of(tester.element(buttonFinder));
expect(material, paintsExactlyCountTimes(#drawRect, 1));
// ignore: avoid_dynamic_calls
expect((material as dynamic).debugInkFeatures, hasLength(1));
await tester.pumpAndSettle();
// ink feature is disposed.
// ignore: avoid_dynamic_calls
expect((material as dynamic).debugInkFeatures, isEmpty);
},
skip: kIsWeb, // [intended] shaders are not yet supported for web.
......
......@@ -10,7 +10,6 @@ void main() {
Finder findMenuPanels(Axis orientation) {
return find.byWidgetPredicate((Widget widget) {
// ignore: avoid_dynamic_calls
return widget.runtimeType.toString() == '_MenuPanel' && (widget as dynamic).orientation == orientation;
});
}
......
......@@ -11,7 +11,6 @@ void main() {
Finder findMenuPanels(Axis orientation) {
return find.byWidgetPredicate((Widget widget) {
// ignore: avoid_dynamic_calls
return widget.runtimeType.toString() == '_MenuPanel' && (widget as dynamic).orientation == orientation;
});
}
......
......@@ -3418,7 +3418,7 @@ void main() {
await tester.pumpAndSettle();
expect(value, equals(0.5));
// Get FocusNode from the state of the slider to include auto-generated FocusNode.
// ignore: avoid_dynamic_calls, invalid_assignment
// ignore: invalid_assignment
final FocusNode focusNode = (tester.firstState(find.byType(Slider)) as dynamic).focusNode;
// The slider does not have focus.
expect(focusNode.hasFocus, false);
......
......@@ -6482,7 +6482,6 @@ void main() {
// Test painter's divider color.
final CustomPaint paint = tester.widget<CustomPaint>(find.byType(CustomPaint).last);
// ignore: avoid_dynamic_calls
expect((paint.painter as dynamic).dividerColor, dividerColor);
});
......
......@@ -1001,7 +1001,6 @@ class Test extends StatelessWidget {
/// This class exists only to make sure that we test all the properties of the
/// [TextStyle] class. If a property is added/removed/renamed, the analyzer will
/// complain that this class has incorrect overrides.
// ignore: avoid_implementing_value_types
class _TextStyleProxy implements TextStyle {
_TextStyleProxy(this._delegate);
......
......@@ -602,7 +602,7 @@ void main() {
render = tester.renderObject(
find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_DayPeriodInputPadding'),
);
expect((render as dynamic).orientation, Orientation.landscape); // ignore: avoid_dynamic_calls
expect((render as dynamic).orientation, Orientation.landscape);
});
testWidgets('setting orientation should override MediaQuery orientation', (WidgetTester tester) async {
......@@ -616,7 +616,7 @@ void main() {
final RenderObject render = tester.renderObject(
find.byWidgetPredicate((Widget w) => '${w.runtimeType}' == '_DayPeriodInputPadding'),
);
expect((render as dynamic).orientation, Orientation.landscape); // ignore: avoid_dynamic_calls
expect((render as dynamic).orientation, Orientation.landscape);
});
testWidgets('builder parameter', (WidgetTester tester) async {
......
......@@ -158,7 +158,7 @@ void main() {
'properties: SemanticsProperties, '
'attributedLabel: "label" [SpellOutStringAttribute(TextRange(start: 0, end: 5))], '
'attributedValue: "value" [LocaleStringAttribute(TextRange(start: 0, end: 5), en-MX)], '
'attributedHint: "hint" [SpellOutStringAttribute(TextRange(start: 1, end: 2))]'// ignore: missing_whitespace_between_adjacent_strings
'attributedHint: "hint" [SpellOutStringAttribute(TextRange(start: 1, end: 2))]' // ignore: missing_whitespace_between_adjacent_strings
')',
);
......
......@@ -1193,7 +1193,6 @@ void main() {
// By default, clipBehavior should be Clip.hardEdge
final RenderObject renderObject = tester.renderObject(find.byType(Overlay));
// ignore: avoid_dynamic_calls
expect((renderObject as dynamic).clipBehavior, equals(Clip.hardEdge));
for (final Clip clip in Clip.values) {
......@@ -1211,7 +1210,6 @@ void main() {
),
);
// ignore: avoid_dynamic_calls
expect((renderObject as dynamic).clipBehavior, clip);
bool visited = false;
renderObject.visitChildren((RenderObject child) {
......@@ -1249,7 +1247,6 @@ void main() {
),
);
final RenderObject renderObject = tester.renderObject(find.byType(Overlay));
// ignore: avoid_dynamic_calls
expect((renderObject as dynamic).paint, paints
..save()
..clipRect(rect: const Rect.fromLTWH(0.0, 0.0, 800.0, 600.0))
......
......@@ -2212,7 +2212,7 @@ void main() {
),
);
// casting to dynamic is required since the state class is private.
// ignore: avoid_dynamic_calls, invalid_assignment
// ignore: invalid_assignment
final FocusNode node = (tester.state(find.byType(UiKitView)) as dynamic).focusNode;
expect(() => ChangeNotifier.debugAssertNotDisposed(node), isNot(throwsAssertionError));
await tester.pumpWidget(
......@@ -3149,7 +3149,7 @@ void main() {
),
);
// casting to dynamic is required since the state class is private.
// ignore: avoid_dynamic_calls, invalid_assignment
// ignore: invalid_assignment
final FocusNode node = (tester.state(find.byType(AppKitView)) as dynamic).focusNode;
expect(() => ChangeNotifier.debugAssertNotDisposed(node), isNot(throwsAssertionError));
await tester.pumpWidget(
......
......@@ -400,7 +400,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
await tester.pump();
// Tap intercepted by the inspector
expect(log, equals(<String>[]));
// ignore: avoid_dynamic_calls
expect(
paragraphText(
WidgetInspectorService.instance.selection.current! as RenderParagraph,
......@@ -421,7 +420,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
expect(log, equals(<String>['bottom']));
log.clear();
// Ensure the inspector selection has not changed to bottom.
// ignore: avoid_dynamic_calls
expect(
paragraphText(
WidgetInspectorService.instance.selection.current! as RenderParagraph,
......@@ -437,7 +435,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
await tester.tap(find.text('BOTTOM'), warnIfMissed: false);
expect(log, equals(<String>[]));
log.clear();
// ignore: avoid_dynamic_calls
expect(
paragraphText(
WidgetInspectorService.instance.selection.current! as RenderParagraph,
......@@ -608,7 +605,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
await tester.longPress(find.byKey(clickTarget), warnIfMissed: false);
// The object with width 95.0 wins over the object with width 94.0 because
// the subtree with width 94.0 is offstage.
// ignore: avoid_dynamic_calls
expect(
WidgetInspectorService.instance.selection.current?.semanticBounds.width,
equals(95.0),
......@@ -616,7 +612,6 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
// Exactly 2 out of the 3 text elements should be in the candidate list of
// objects to select as only 2 are onstage.
// ignore: avoid_dynamic_calls
expect(
WidgetInspectorService.instance.selection.candidates
.whereType<RenderParagraph>()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment