mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Remove some outdated ignores from framework (#108915)
This commit is contained in:
parent
f34b8d1f4e
commit
ed0c8d77f8
@ -670,7 +670,7 @@ class FlutterErrorDetails with Diagnosticable {
|
|||||||
super.debugFillProperties(properties);
|
super.debugFillProperties(properties);
|
||||||
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
|
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
|
||||||
final Diagnosticable? diagnosticable = _exceptionToDiagnosticable();
|
final Diagnosticable? diagnosticable = _exceptionToDiagnosticable();
|
||||||
if (exception is NullThrownError) { // ignore: deprecated_member_use
|
if (exception is NullThrownError) {
|
||||||
properties.add(ErrorDescription('The null value was $verb.'));
|
properties.add(ErrorDescription('The null value was $verb.'));
|
||||||
} else if (exception is num) {
|
} else if (exception is num) {
|
||||||
properties.add(ErrorDescription('The number $exception was $verb.'));
|
properties.add(ErrorDescription('The number $exception was $verb.'));
|
||||||
|
@ -250,8 +250,6 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
|
|||||||
/// {@macro flutter.gestures.GestureRecognizer.supportedDevices}
|
/// {@macro flutter.gestures.GestureRecognizer.supportedDevices}
|
||||||
LongPressGestureRecognizer({
|
LongPressGestureRecognizer({
|
||||||
Duration? duration,
|
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,
|
super.postAcceptSlopTolerance = null,
|
||||||
@Deprecated(
|
@Deprecated(
|
||||||
'Migrate to supportedDevices. '
|
'Migrate to supportedDevices. '
|
||||||
|
@ -781,7 +781,7 @@ abstract class StatefulWidget extends Widget {
|
|||||||
/// [State] objects.
|
/// [State] objects.
|
||||||
@protected
|
@protected
|
||||||
@factory
|
@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.
|
/// Tracks the lifecycle of [State] objects when asserts are enabled.
|
||||||
|
@ -297,7 +297,7 @@ abstract class ImplicitlyAnimatedWidget extends StatefulWidget {
|
|||||||
final VoidCallback? onEnd;
|
final VoidCallback? onEnd;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ImplicitlyAnimatedWidgetState<ImplicitlyAnimatedWidget> createState(); // ignore: no_logic_in_create_state, https://github.com/dart-lang/linter/issues/2345
|
ImplicitlyAnimatedWidgetState<ImplicitlyAnimatedWidget> createState();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||||
|
@ -28,7 +28,7 @@ abstract class UniqueWidget<T extends State<StatefulWidget>> extends StatefulWid
|
|||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
@override
|
@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.
|
/// The state for the unique inflated instance of this widget.
|
||||||
///
|
///
|
||||||
|
@ -978,7 +978,7 @@ mixin WidgetInspectorService {
|
|||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
assert(() {
|
assert(() {
|
||||||
// TODO(kenz): add support for structured errors on the web.
|
// 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 true;
|
||||||
}());
|
}());
|
||||||
return enabled;
|
return enabled;
|
||||||
|
@ -16,7 +16,7 @@ void main() async {
|
|||||||
try {
|
try {
|
||||||
await compute(throwNull, null);
|
await compute(throwNull, null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e is! NullThrownError) { // ignore: deprecated_member_use
|
if (e is! NullThrownError) {
|
||||||
throw Exception('compute returned bad result');
|
throw Exception('compute returned bad result');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
FlutterErrorDetails(
|
FlutterErrorDetails(
|
||||||
exception: NullThrownError(), // ignore: deprecated_member_use
|
exception: NullThrownError(),
|
||||||
library: 'LIBRARY',
|
library: 'LIBRARY',
|
||||||
context: ErrorDescription('CONTEXTING'),
|
context: ErrorDescription('CONTEXTING'),
|
||||||
informationCollector: () sync* {
|
informationCollector: () sync* {
|
||||||
@ -113,7 +113,6 @@ void main() {
|
|||||||
'═════════════════════════════════════════════════════════════════\n',
|
'═════════════════════════════════════════════════════════════════\n',
|
||||||
);
|
);
|
||||||
expect(
|
expect(
|
||||||
// ignore: deprecated_member_use
|
|
||||||
FlutterErrorDetails(exception: NullThrownError()).toString(),
|
FlutterErrorDetails(exception: NullThrownError()).toString(),
|
||||||
'══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n'
|
'══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n'
|
||||||
'The null value was thrown.\n'
|
'The null value was thrown.\n'
|
||||||
|
@ -148,11 +148,9 @@ void main() {
|
|||||||
viewportDimension: 100.0,
|
viewportDimension: 100.0,
|
||||||
axisDirection: AxisDirection.down,
|
axisDirection: AxisDirection.down,
|
||||||
);
|
);
|
||||||
// ignore: avoid_dynamic_calls
|
|
||||||
scrollPainter!.update(metrics, AxisDirection.down);
|
scrollPainter!.update(metrics, AxisDirection.down);
|
||||||
|
|
||||||
final TestCanvas canvas = TestCanvas();
|
final TestCanvas canvas = TestCanvas();
|
||||||
// ignore: avoid_dynamic_calls
|
|
||||||
scrollPainter.paint(canvas, const Size(10.0, 100.0));
|
scrollPainter.paint(canvas, const Size(10.0, 100.0));
|
||||||
|
|
||||||
// Scrollbar is not supposed to draw anything if there isn't enough content.
|
// Scrollbar is not supposed to draw anything if there isn't enough content.
|
||||||
|
@ -20,7 +20,7 @@ class PaintingBindingSpy extends BindingBase with SchedulerBinding, ServicesBind
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// ignore: MUST_CALL_SUPER
|
// ignore: must_call_super
|
||||||
void initLicenses() {
|
void initLicenses() {
|
||||||
// Do not include any licenses, because we're a test, and the LICENSE file
|
// Do not include any licenses, because we're a test, and the LICENSE file
|
||||||
// doesn't get generated for tests.
|
// doesn't get generated for tests.
|
||||||
|
@ -222,7 +222,6 @@ class TestRenderSliverFixedExtentBoxAdaptor extends RenderSliverFixedExtentBoxAd
|
|||||||
:super(childManager: TestRenderSliverBoxChildManager(children: <RenderBox>[]));
|
:super(childManager: TestRenderSliverBoxChildManager(children: <RenderBox>[]));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// ignore: unnecessary_overrides
|
|
||||||
int getMaxChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
|
int getMaxChildIndexForScrollOffset(double scrollOffset, double itemExtent) {
|
||||||
return super.getMaxChildIndexForScrollOffset(scrollOffset, itemExtent);
|
return super.getMaxChildIndexForScrollOffset(scrollOffset, itemExtent);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,6 @@ void main() {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
// While ShiftLeft is held (the event of which was skipped), press keyA.
|
// While ShiftLeft is held (the event of which was skipped), press keyA.
|
||||||
// ignore: prefer_const_declarations
|
|
||||||
final Map<String, dynamic> rawMessage = kIsWeb ? (
|
final Map<String, dynamic> rawMessage = kIsWeb ? (
|
||||||
KeyEventSimulator.getKeyData(
|
KeyEventSimulator.getKeyData(
|
||||||
LogicalKeyboardKey.keyA,
|
LogicalKeyboardKey.keyA,
|
||||||
|
@ -1268,7 +1268,7 @@ void main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('scheduleBuild while debugBuildingDirtyElements is true', (WidgetTester tester) async {
|
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
|
// ignore: invalid_use_of_protected_member
|
||||||
tester.binding.debugBuildingDirtyElements = true;
|
tester.binding.debugBuildingDirtyElements = true;
|
||||||
late FlutterError error;
|
late FlutterError error;
|
||||||
|
@ -62,7 +62,7 @@ void main() {
|
|||||||
focusNode.requestFocus();
|
focusNode.requestFocus();
|
||||||
await tester.idle();
|
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();
|
await tester.idle();
|
||||||
|
|
||||||
expect(events.length, 2);
|
expect(events.length, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user