Remove some outdated ignores from framework (#108915)

This commit is contained in:
Michael Goderbauer 2022-08-03 15:42:06 -07:00 committed by GitHub
parent f34b8d1f4e
commit ed0c8d77f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 10 additions and 17 deletions

View File

@ -670,7 +670,7 @@ class FlutterErrorDetails with Diagnosticable {
super.debugFillProperties(properties);
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
final Diagnosticable? diagnosticable = _exceptionToDiagnosticable();
if (exception is NullThrownError) { // ignore: deprecated_member_use
if (exception is NullThrownError) {
properties.add(ErrorDescription('The null value was $verb.'));
} else if (exception is num) {
properties.add(ErrorDescription('The number $exception was $verb.'));

View File

@ -250,8 +250,6 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
/// {@macro flutter.gestures.GestureRecognizer.supportedDevices}
LongPressGestureRecognizer({
Duration? duration,
// TODO(goderbauer): remove ignore when https://github.com/dart-lang/linter/issues/3349 is fixed.
// ignore: avoid_init_to_null
super.postAcceptSlopTolerance = null,
@Deprecated(
'Migrate to supportedDevices. '

View File

@ -781,7 +781,7 @@ abstract class StatefulWidget extends Widget {
/// [State] objects.
@protected
@factory
State createState(); // ignore: no_logic_in_create_state, this is the original sin
State createState();
}
/// Tracks the lifecycle of [State] objects when asserts are enabled.

View File

@ -297,7 +297,7 @@ abstract class ImplicitlyAnimatedWidget extends StatefulWidget {
final VoidCallback? onEnd;
@override
ImplicitlyAnimatedWidgetState<ImplicitlyAnimatedWidget> createState(); // ignore: no_logic_in_create_state, https://github.com/dart-lang/linter/issues/2345
ImplicitlyAnimatedWidgetState<ImplicitlyAnimatedWidget> createState();
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {

View File

@ -28,7 +28,7 @@ abstract class UniqueWidget<T extends State<StatefulWidget>> extends StatefulWid
super(key: key);
@override
T createState(); // ignore: no_logic_in_create_state, https://github.com/dart-lang/linter/issues/2345
T createState();
/// The state for the unique inflated instance of this widget.
///

View File

@ -978,7 +978,7 @@ mixin WidgetInspectorService {
bool enabled = false;
assert(() {
// TODO(kenz): add support for structured errors on the web.
enabled = const bool.fromEnvironment('flutter.inspector.structuredErrors', defaultValue: !kIsWeb); // ignore: avoid_redundant_argument_values
enabled = const bool.fromEnvironment('flutter.inspector.structuredErrors', defaultValue: !kIsWeb);
return true;
}());
return enabled;

View File

@ -16,7 +16,7 @@ void main() async {
try {
await compute(throwNull, null);
} catch (e) {
if (e is! NullThrownError) { // ignore: deprecated_member_use
if (e is! NullThrownError) {
throw Exception('compute returned bad result');
}
}

View File

@ -60,7 +60,7 @@ void main() {
);
expect(
FlutterErrorDetails(
exception: NullThrownError(), // ignore: deprecated_member_use
exception: NullThrownError(),
library: 'LIBRARY',
context: ErrorDescription('CONTEXTING'),
informationCollector: () sync* {
@ -113,7 +113,6 @@ void main() {
'═════════════════════════════════════════════════════════════════\n',
);
expect(
// ignore: deprecated_member_use
FlutterErrorDetails(exception: NullThrownError()).toString(),
'══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n'
'The null value was thrown.\n'

View File

@ -148,11 +148,9 @@ void main() {
viewportDimension: 100.0,
axisDirection: AxisDirection.down,
);
// ignore: avoid_dynamic_calls
scrollPainter!.update(metrics, AxisDirection.down);
final TestCanvas canvas = TestCanvas();
// ignore: avoid_dynamic_calls
scrollPainter.paint(canvas, const Size(10.0, 100.0));
// Scrollbar is not supposed to draw anything if there isn't enough content.

View File

@ -20,7 +20,7 @@ class PaintingBindingSpy extends BindingBase with SchedulerBinding, ServicesBind
}
@override
// ignore: MUST_CALL_SUPER
// ignore: must_call_super
void initLicenses() {
// Do not include any licenses, because we're a test, and the LICENSE file
// doesn't get generated for tests.

View File

@ -222,7 +222,6 @@ class TestRenderSliverFixedExtentBoxAdaptor extends RenderSliverFixedExtentBoxAd
:super(childManager: TestRenderSliverBoxChildManager(children: <RenderBox>[]));
@override
// ignore: unnecessary_overrides
int getMaxChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
return super.getMaxChildIndexForScrollOffset(scrollOffset, itemExtent);
}

View File

@ -75,7 +75,6 @@ void main() {
return false;
});
// While ShiftLeft is held (the event of which was skipped), press keyA.
// ignore: prefer_const_declarations
final Map<String, dynamic> rawMessage = kIsWeb ? (
KeyEventSimulator.getKeyData(
LogicalKeyboardKey.keyA,

View File

@ -1268,7 +1268,7 @@ void main() {
});
testWidgets('scheduleBuild while debugBuildingDirtyElements is true', (WidgetTester tester) async {
/// ignore here is required for testing purpose because changing the flag properly is hard
// ignore here is required for testing purpose because changing the flag properly is hard
// ignore: invalid_use_of_protected_member
tester.binding.debugBuildingDirtyElements = true;
late FlutterError error;

View File

@ -62,7 +62,7 @@ void main() {
focusNode.requestFocus();
await tester.idle();
await tester.sendKeyEvent(LogicalKeyboardKey.metaLeft, platform: 'web'); // ignore: avoid_redundant_argument_values
await tester.sendKeyEvent(LogicalKeyboardKey.metaLeft, platform: 'web');
await tester.idle();
expect(events.length, 2);