Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1cc8218

Browse files
committed
Remove some outdated ignores from framework
1 parent ec2621f commit 1cc8218

14 files changed

+10
-17
lines changed

packages/flutter/lib/src/foundation/assertions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ class FlutterErrorDetails with Diagnosticable {
670670
super.debugFillProperties(properties);
671671
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
672672
final Diagnosticable? diagnosticable = _exceptionToDiagnosticable();
673-
if (exception is NullThrownError) { // ignore: deprecated_member_use
673+
if (exception is NullThrownError) {
674674
properties.add(ErrorDescription('The null value was $verb.'));
675675
} else if (exception is num) {
676676
properties.add(ErrorDescription('The number $exception was $verb.'));

packages/flutter/lib/src/gestures/long_press.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
250250
/// {@macro flutter.gestures.GestureRecognizer.supportedDevices}
251251
LongPressGestureRecognizer({
252252
Duration? duration,
253-
// TODO(goderbauer): remove ignore when https://github.com/dart-lang/linter/issues/3349 is fixed.
254-
// ignore: avoid_init_to_null
255253
super.postAcceptSlopTolerance = null,
256254
@Deprecated(
257255
'Migrate to supportedDevices. '

packages/flutter/lib/src/widgets/framework.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ abstract class StatefulWidget extends Widget {
781781
/// [State] objects.
782782
@protected
783783
@factory
784-
State createState(); // ignore: no_logic_in_create_state, this is the original sin
784+
State createState();
785785
}
786786

787787
/// Tracks the lifecycle of [State] objects when asserts are enabled.

packages/flutter/lib/src/widgets/implicit_animations.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ abstract class ImplicitlyAnimatedWidget extends StatefulWidget {
297297
final VoidCallback? onEnd;
298298

299299
@override
300-
ImplicitlyAnimatedWidgetState<ImplicitlyAnimatedWidget> createState(); // ignore: no_logic_in_create_state, https://github.com/dart-lang/linter/issues/2345
300+
ImplicitlyAnimatedWidgetState<ImplicitlyAnimatedWidget> createState();
301301

302302
@override
303303
void debugFillProperties(DiagnosticPropertiesBuilder properties) {

packages/flutter/lib/src/widgets/unique_widget.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ abstract class UniqueWidget<T extends State<StatefulWidget>> extends StatefulWid
2828
super(key: key);
2929

3030
@override
31-
T createState(); // ignore: no_logic_in_create_state, https://github.com/dart-lang/linter/issues/2345
31+
T createState();
3232

3333
/// The state for the unique inflated instance of this widget.
3434
///

packages/flutter/lib/src/widgets/widget_inspector.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ mixin WidgetInspectorService {
978978
bool enabled = false;
979979
assert(() {
980980
// TODO(kenz): add support for structured errors on the web.
981-
enabled = const bool.fromEnvironment('flutter.inspector.structuredErrors', defaultValue: !kIsWeb); // ignore: avoid_redundant_argument_values
981+
enabled = const bool.fromEnvironment('flutter.inspector.structuredErrors', defaultValue: !kIsWeb);
982982
return true;
983983
}());
984984
return enabled;

packages/flutter/test/foundation/_compute_caller_unsound_null_safety_error.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void main() async {
1616
try {
1717
await compute(throwNull, null);
1818
} catch (e) {
19-
if (e is! NullThrownError) { // ignore: deprecated_member_use
19+
if (e is! NullThrownError) {
2020
throw Exception('compute returned bad result');
2121
}
2222
}

packages/flutter/test/foundation/assertions_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void main() {
6060
);
6161
expect(
6262
FlutterErrorDetails(
63-
exception: NullThrownError(), // ignore: deprecated_member_use
63+
exception: NullThrownError(),
6464
library: 'LIBRARY',
6565
context: ErrorDescription('CONTEXTING'),
6666
informationCollector: () sync* {
@@ -113,7 +113,6 @@ void main() {
113113
'═════════════════════════════════════════════════════════════════\n',
114114
);
115115
expect(
116-
// ignore: deprecated_member_use
117116
FlutterErrorDetails(exception: NullThrownError()).toString(),
118117
'══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n'
119118
'The null value was thrown.\n'

packages/flutter/test/material/scrollbar_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,9 @@ void main() {
148148
viewportDimension: 100.0,
149149
axisDirection: AxisDirection.down,
150150
);
151-
// ignore: avoid_dynamic_calls
152151
scrollPainter!.update(metrics, AxisDirection.down);
153152

154153
final TestCanvas canvas = TestCanvas();
155-
// ignore: avoid_dynamic_calls
156154
scrollPainter.paint(canvas, const Size(10.0, 100.0));
157155

158156
// Scrollbar is not supposed to draw anything if there isn't enough content.

packages/flutter/test/painting/painting_utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class PaintingBindingSpy extends BindingBase with SchedulerBinding, ServicesBind
2020
}
2121

2222
@override
23-
// ignore: MUST_CALL_SUPER
23+
// ignore: must_call_super
2424
void initLicenses() {
2525
// Do not include any licenses, because we're a test, and the LICENSE file
2626
// doesn't get generated for tests.

packages/flutter/test/rendering/sliver_fixed_extent_layout_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ class TestRenderSliverFixedExtentBoxAdaptor extends RenderSliverFixedExtentBoxAd
222222
:super(childManager: TestRenderSliverBoxChildManager(children: <RenderBox>[]));
223223

224224
@override
225-
// ignore: unnecessary_overrides
226225
int getMaxChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
227226
return super.getMaxChildIndexForScrollOffset(scrollOffset, itemExtent);
228227
}

packages/flutter/test/services/hardware_keyboard_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ void main() {
7575
return false;
7676
});
7777
// While ShiftLeft is held (the event of which was skipped), press keyA.
78-
// ignore: prefer_const_declarations
7978
final Map<String, dynamic> rawMessage = kIsWeb ? (
8079
KeyEventSimulator.getKeyData(
8180
LogicalKeyboardKey.keyA,

packages/flutter/test/widgets/framework_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,7 @@ void main() {
12681268
});
12691269

12701270
testWidgets('scheduleBuild while debugBuildingDirtyElements is true', (WidgetTester tester) async {
1271-
/// ignore here is required for testing purpose because changing the flag properly is hard
1271+
// ignore here is required for testing purpose because changing the flag properly is hard
12721272
// ignore: invalid_use_of_protected_member
12731273
tester.binding.debugBuildingDirtyElements = true;
12741274
late FlutterError error;

packages/flutter/test/widgets/raw_keyboard_listener_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void main() {
6262
focusNode.requestFocus();
6363
await tester.idle();
6464

65-
await tester.sendKeyEvent(LogicalKeyboardKey.metaLeft, platform: 'web'); // ignore: avoid_redundant_argument_values
65+
await tester.sendKeyEvent(LogicalKeyboardKey.metaLeft, platform: 'web');
6666
await tester.idle();
6767

6868
expect(events.length, 2);

0 commit comments

Comments
 (0)