From d6995aa24993178bd5c9a4e0ced2961f4e6aca76 Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Tue, 29 Nov 2022 03:09:56 +0100 Subject: [PATCH] Ignore NullThrownError deprecation (#116135) * Ignore NullThrownError deprecation * Fix whitespace --- packages/flutter/lib/src/foundation/assertions.dart | 2 +- .../foundation/_compute_caller_unsound_null_safety_error.dart | 2 +- packages/flutter/test/foundation/assertions_test.dart | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index c43d958de3..c95e64ce48 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.dart @@ -672,7 +672,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) { + if (exception is NullThrownError) { // ignore: deprecated_member_use properties.add(ErrorDescription('The null value was $verb.')); } else if (exception is num) { properties.add(ErrorDescription('The number $exception was $verb.')); diff --git a/packages/flutter/test/foundation/_compute_caller_unsound_null_safety_error.dart b/packages/flutter/test/foundation/_compute_caller_unsound_null_safety_error.dart index d8fba6b2d8..3f9be4efb2 100644 --- a/packages/flutter/test/foundation/_compute_caller_unsound_null_safety_error.dart +++ b/packages/flutter/test/foundation/_compute_caller_unsound_null_safety_error.dart @@ -15,7 +15,7 @@ void main() async { try { await compute(throwNull, null); } catch (e) { - if (e is! TypeError && e is! NullThrownError) { + if (e is! TypeError && e is! NullThrownError) { // ignore: deprecated_member_use throw Exception('compute returned bad result'); } } diff --git a/packages/flutter/test/foundation/assertions_test.dart b/packages/flutter/test/foundation/assertions_test.dart index 88e1d1da46..7428e38e49 100644 --- a/packages/flutter/test/foundation/assertions_test.dart +++ b/packages/flutter/test/foundation/assertions_test.dart @@ -60,7 +60,7 @@ void main() { ); expect( FlutterErrorDetails( - exception: NullThrownError(), + exception: NullThrownError(), // ignore: deprecated_member_use library: 'LIBRARY', context: ErrorDescription('CONTEXTING'), informationCollector: () sync* { @@ -113,6 +113,7 @@ void main() { '═════════════════════════════════════════════════════════════════\n', ); expect( + // ignore: deprecated_member_use FlutterErrorDetails(exception: NullThrownError()).toString(), '══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n' 'The null value was thrown.\n'