Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 3f401a1

Browse files
authored
Ignore uses of soon-to-be deprecated NullThrownError. (#105693)
1 parent a783e42 commit 3f401a1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,7 @@ class FlutterErrorDetails with Diagnosticable {
395395
/// subsequently be reported using [FlutterError.onError].
396396
///
397397
/// The [exception] must not be null; other arguments can be left to
398-
/// their default values. (`throw null` results in a
399-
/// [NullThrownError] exception.)
398+
/// their default values.
400399
const FlutterErrorDetails({
401400
required this.exception,
402401
this.stack,
@@ -671,7 +670,7 @@ class FlutterErrorDetails with Diagnosticable {
671670
super.debugFillProperties(properties);
672671
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
673672
final Diagnosticable? diagnosticable = _exceptionToDiagnosticable();
674-
if (exception is NullThrownError) {
673+
if (exception is NullThrownError) { // ignore: deprecated_member_use
675674
properties.add(ErrorDescription('The null value was $verb.'));
676675
} else if (exception is num) {
677676
properties.add(ErrorDescription('The number $exception was $verb.'));

packages/flutter/test/foundation/assertions_test.dart

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

0 commit comments

Comments
 (0)