Skip to content

Commit

Permalink
cleanup now-irrelevant ignores for deprecated_member_use (#143403)
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer authored Feb 14, 2024
1 parent f190d62 commit 3f09b23
Show file tree
Hide file tree
Showing 33 changed files with 17 additions and 241 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ class _AnimationDemoHomeState extends State<AnimationDemoHome> {
if (notification.depth == 0 && notification is ScrollUpdateNotification) {
selectedIndex.value = leader.page;
if (follower.page != leader.page) {
follower.position.jumpToWithoutSettling(leader.position.pixels); // ignore: deprecated_member_use
follower.position.jumpToWithoutSettling(leader.position.pixels);
}
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class _OptionsItem extends StatelessWidget {

@override
Widget build(BuildContext context) {
// ignore: deprecated_member_use, https://github.com/flutter/flutter/issues/128825
final double textScaleFactor = MediaQuery.textScalerOf(context).textScaleFactor;

return MergeSemantics(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:flutter/services.dart';

// TODO(gspencergoog): Delete this example when deprecated RawKeyEvent API is
// removed.
// ignore_for_file: deprecated_member_use

/// Flutter code sample for [KeyEventManager.keyMessageHandler].
Expand Down
1 change: 0 additions & 1 deletion packages/flutter/lib/src/cupertino/context_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ class CupertinoContextMenu extends StatefulWidget {
/// // The FittedBox in the preview here allows the image to animate its
/// // aspect ratio when the CupertinoContextMenu is animating its preview
/// // widget open and closed.
/// // ignore: deprecated_member_use
/// previewBuilder: (BuildContext context, Animation<double> animation, Widget child) {
/// return FittedBox(
/// fit: BoxFit.cover,
Expand Down
4 changes: 2 additions & 2 deletions packages/flutter/lib/src/foundation/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'dart:async';
import 'dart:convert' show json;
import 'dart:developer' as developer;
import 'dart:io' show exit;
import 'dart:ui' as ui show Brightness, PlatformDispatcher, SingletonFlutterWindow, window; // ignore: deprecated_member_use
import 'dart:ui' as ui show Brightness, PlatformDispatcher, SingletonFlutterWindow, window;

// Before adding any more dart:ui imports, please read the README.

Expand All @@ -22,7 +22,7 @@ import 'print.dart';
import 'service_extensions.dart';
import 'timeline.dart';

export 'dart:ui' show PlatformDispatcher, SingletonFlutterWindow, clampDouble; // ignore: deprecated_member_use
export 'dart:ui' show PlatformDispatcher, SingletonFlutterWindow, clampDouble;

export 'basic_types.dart' show AsyncCallback, AsyncValueGetter, AsyncValueSetter;

Expand Down
1 change: 0 additions & 1 deletion packages/flutter/lib/src/foundation/diagnostics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2929,7 +2929,6 @@ String describeIdentity(Object? object) => '${objectRuntimeType(object, '<optimi
///
/// void validateDescribeEnum() {
/// assert(Day.monday.toString() == 'Day.monday');
/// // ignore: deprecated_member_use
/// assert(describeEnum(Day.monday) == 'monday');
/// assert(Day.monday.name == 'monday'); // preferred for real enums
/// }
Expand Down
6 changes: 2 additions & 4 deletions packages/flutter/lib/src/painting/basic_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ export 'dart:ui' show
TextPosition,
TileMode,
VertexMode,
// TODO(werainkhatri): remove these after their deprecation period in engine
// https://github.com/flutter/flutter/pull/99505
hashList, // ignore: deprecated_member_use
hashValues; // ignore: deprecated_member_use
hashList,
hashValues;

export 'package:flutter/foundation.dart' show VoidCallback;

Expand Down
3 changes: 0 additions & 3 deletions packages/flutter/lib/src/services/hardware_keyboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -777,17 +777,14 @@ enum KeyDataTransitMode {
/// using [combineKeyEventResults].
///
/// ```dart
/// // ignore: deprecated_member_use
/// void handleMessage(FocusNode node, KeyMessage message) {
/// final List<KeyEventResult> results = <KeyEventResult>[];
/// if (node.onKeyEvent != null) {
/// for (final KeyEvent event in message.events) {
/// results.add(node.onKeyEvent!(node, event));
/// }
/// }
/// // ignore: deprecated_member_use
/// if (node.onKey != null && message.rawEvent != null) {
/// // ignore: deprecated_member_use
/// results.add(node.onKey!(node, message.rawEvent!));
/// }
/// final KeyEventResult result = combineKeyEventResults(results);
Expand Down
6 changes: 0 additions & 6 deletions packages/flutter/test/cupertino/text_field_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7832,9 +7832,6 @@ void main() {
await tester.sendKeyEvent(LogicalKeyboardKey.arrowRight);
await tester.pump();
expect(focusNode3.hasPrimaryFocus, isTrue);
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Scrolling shortcuts are disabled in text fields', (WidgetTester tester) async {
Expand Down Expand Up @@ -7869,9 +7866,6 @@ void main() {

await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
expect(scrollInvoked, isFalse);
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Cupertino text field semantics', (WidgetTester tester) async {
Expand Down
39 changes: 0 additions & 39 deletions packages/flutter/test/material/text_field_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7093,9 +7093,6 @@ void main() {
await tester.sendKeyEvent(LogicalKeyboardKey.arrowLeft);
await tester.sendKeyUpEvent(LogicalKeyboardKey.shift);
expect(controller.selection.extentOffset - controller.selection.baseOffset, -1);
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Shift test 2', (WidgetTester tester) async {
Expand All @@ -7114,9 +7111,6 @@ void main() {
await tester.sendKeyDownEvent(LogicalKeyboardKey.arrowRight);
await tester.pumpAndSettle();
expect(controller.selection.extentOffset - controller.selection.baseOffset, 1);
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Control Shift test', (WidgetTester tester) async {
Expand All @@ -7134,9 +7128,6 @@ void main() {
await tester.pumpAndSettle();

expect(controller.selection.extentOffset - controller.selection.baseOffset, 5);
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Down and up test', (WidgetTester tester) async {
Expand Down Expand Up @@ -7164,9 +7155,6 @@ void main() {
await tester.pumpAndSettle();

expect(controller.selection.extentOffset - controller.selection.baseOffset, 0);
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Down and up test 2', (WidgetTester tester) async {
Expand Down Expand Up @@ -7223,9 +7211,6 @@ void main() {
await tester.pumpAndSettle();

expect(controller.selection.extentOffset - controller.selection.baseOffset, -5);
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Read only keyboard selection test', (WidgetTester tester) async {
Expand All @@ -7246,9 +7231,6 @@ void main() {
await tester.sendKeyDownEvent(LogicalKeyboardKey.shift);
await tester.sendKeyDownEvent(LogicalKeyboardKey.arrowLeft);
expect(controller.selection.extentOffset - controller.selection.baseOffset, -1);
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());
}, skip: areKeyEventsHandledByPlatform); // [intended] only applies to platforms where we handle key events.

Expand Down Expand Up @@ -7326,9 +7308,6 @@ void main() {
expect(find.text(expected), findsOneWidget, reason: 'Because text contains ${controller.text}');
},
skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events.
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
variant: KeySimulatorTransitModeVariant.all()
);

Expand Down Expand Up @@ -7382,9 +7361,6 @@ void main() {
expect(find.text(clipboardContent), findsOneWidget);
},
skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events.
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
variant: KeySimulatorTransitModeVariant.all(),
);

Expand Down Expand Up @@ -7464,9 +7440,6 @@ void main() {
expect(find.text(expected), findsOneWidget);
},
skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events.
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
variant: KeySimulatorTransitModeVariant.all()
);

Expand Down Expand Up @@ -7518,9 +7491,6 @@ void main() {
expect(find.text(expected), findsOneWidget);
},
skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events.
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
variant: KeySimulatorTransitModeVariant.all()
);

Expand Down Expand Up @@ -7575,9 +7545,6 @@ void main() {
expect(find.text(expected2), findsOneWidget);
},
skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events.
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
variant: KeySimulatorTransitModeVariant.all(),
);

Expand Down Expand Up @@ -7673,9 +7640,6 @@ void main() {
expect(c1.selection.extentOffset - c1.selection.baseOffset, -10);
},
skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events.
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
variant: KeySimulatorTransitModeVariant.all()
);

Expand Down Expand Up @@ -7753,9 +7717,6 @@ void main() {
expect(c2.selection.extentOffset - c2.selection.baseOffset, -5);
},
skip: areKeyEventsHandledByPlatform, // [intended] only applies to platforms where we handle key events.
// TODO(gspencergoog): Remove the variant when the deprecated
// KeySimulatorTransitModeVariant API is removed.
// ignore: deprecated_member_use
variant: KeySimulatorTransitModeVariant.all()
);

Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/test/painting/binding_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class TestBindingBase implements BindingBase {
void unlocked() {}

@override
ui.SingletonFlutterWindow get window => throw UnimplementedError(); // ignore: deprecated_member_use
ui.SingletonFlutterWindow get window => throw UnimplementedError();

@override
ui.PlatformDispatcher get platformDispatcher => throw UnimplementedError();
Expand Down
7 changes: 0 additions & 7 deletions packages/flutter/test/services/hardware_keyboard_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ void main() {
equals(<LogicalKeyboardKey>{}));
expect(HardwareKeyboard.instance.lockModesEnabled,
equals(<KeyboardLockMode>{}));
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData());

testWidgets('KeyEvent can tell which keys are pressed', (WidgetTester tester) async {
Expand Down Expand Up @@ -101,7 +100,6 @@ void main() {
await simulateKeyUpEvent(LogicalKeyboardKey.numLock, platform: 'windows');
expect(HardwareKeyboard.instance.isPhysicalKeyPressed(PhysicalKeyboardKey.numLock), isFalse);
expect(HardwareKeyboard.instance.isLogicalKeyPressed(LogicalKeyboardKey.numLock), isFalse);
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData());

testWidgets('KeyboardManager synthesizes modifier keys in rawKeyData mode', (WidgetTester tester) async {
Expand Down Expand Up @@ -229,7 +227,6 @@ void main() {
true);
expect(logs, <int>[3, 2, 1]);
logs.clear();
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

// Regression test for https://github.com/flutter/flutter/issues/99196 .
Expand Down Expand Up @@ -279,7 +276,6 @@ void main() {
expect(ServicesBinding.instance.keyboard.physicalKeysPressed, equals(<PhysicalKeyboardKey>{
PhysicalKeyboardKey.keyA,
}));
// ignore: deprecated_member_use
}, variant: const KeySimulatorTransitModeVariant(<KeyDataTransitMode>{
KeyDataTransitMode.rawKeyData,
}));
Expand Down Expand Up @@ -315,7 +311,6 @@ void main() {
)), false);
expect(logs, <int>[2, 1]);
logs.clear();
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData());

testWidgets('Postpone synthesized key events when the queue is not empty', (WidgetTester tester) async {
Expand Down Expand Up @@ -370,7 +365,6 @@ void main() {

expect(logs, <String>['RawKeyDownEvent', 'KeyDownEvent', 'KeyUpEvent']);
logs.clear();
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData());

// The first key data received from the engine might be an empty key data.
Expand Down Expand Up @@ -510,7 +504,6 @@ void main() {
// If the previous state (key down) wasn't recorded, this key up event will
// trigger assertions.
expect(record, isNull);
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('debugPrintKeyboardEvents causes logging of key events', (WidgetTester tester) async {
Expand Down
2 changes: 0 additions & 2 deletions packages/flutter/test/services/raw_keyboard_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,6 @@ void main() {
false);
expect(logs, <int>[1, 3, 2]);
logs.clear();
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Exceptions from RawKeyboard listeners are caught and reported', (WidgetTester tester) async {
Expand Down Expand Up @@ -2154,7 +2153,6 @@ void main() {
expect(events, isEmpty);
expect(lastHandled, true);
expect(RawKeyboard.instance.keysPressed, isEmpty);
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.keyDataThenRawKeyData());

test('data.toString', () {
Expand Down
1 change: 0 additions & 1 deletion packages/flutter/test/widgets/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ void main() {
await tester.sendKeyEvent(LogicalKeyboardKey.select);
await tester.pumpAndSettle();
expect(checked, isTrue);
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

group('error control test', () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ void main() {

debugDefaultTargetPlatformOverride = null;
},
// ignore: deprecated_member_use
variant: KeySimulatorTransitModeVariant.all(),
);

Expand Down
1 change: 0 additions & 1 deletion packages/flutter/test/widgets/editable_text_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12556,7 +12556,6 @@ void main() {
expect(controller.selection.isCollapsed, true);
expect(controller.selection.baseOffset, 0);
}
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('the toolbar is disposed when selection changes and there is no selectionControls', (WidgetTester tester) async {
Expand Down
4 changes: 0 additions & 4 deletions packages/flutter/test/widgets/focus_manager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ void main() {
false);
expect(logs, <int>[20, 21, 10, 11]);
logs.clear();
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('FocusManager responds to app lifecycle changes.', (WidgetTester tester) async {
Expand Down Expand Up @@ -1327,7 +1326,6 @@ void main() {
// Since none of the focused nodes handle this event, nothing should
// receive it.
expect(receivedAnEvent, isEmpty);
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('Initial highlight mode guesses correctly.', (WidgetTester tester) async {
Expand Down Expand Up @@ -1960,7 +1958,6 @@ void main() {
expect(await simulateKeyDownEvent(LogicalKeyboardKey.digit1), true);
expect(await simulateKeyUpEvent(LogicalKeyboardKey.digit1), false);
expect(logs, <int>[0, 1, 0, 1]);
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('FocusManager.addLateKeyEventHandler works', (WidgetTester tester) async {
Expand Down Expand Up @@ -2040,7 +2037,6 @@ void main() {
expect(await simulateKeyDownEvent(LogicalKeyboardKey.digit1), true);
expect(await simulateKeyUpEvent(LogicalKeyboardKey.digit1), false);
expect(logs, <int>[0, 1, 0, 1]);
// ignore: deprecated_member_use
}, variant: KeySimulatorTransitModeVariant.all());

testWidgets('FocusManager notifies listeners when a widget loses focus because it was removed.', (WidgetTester tester) async {
Expand Down
Loading

0 comments on commit 3f09b23

Please sign in to comment.