Skip to content

Commit f5249bc

Browse files
authored
Remove use of NullThrownError (#116122)
1 parent 7211ca0 commit f5249bc

File tree

5 files changed

+1
-88
lines changed

5 files changed

+1
-88
lines changed

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -672,9 +672,7 @@ class FlutterErrorDetails with Diagnosticable {
672672
super.debugFillProperties(properties);
673673
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
674674
final Diagnosticable? diagnosticable = _exceptionToDiagnosticable();
675-
if (exception is NullThrownError) { // ignore: deprecated_member_use
676-
properties.add(ErrorDescription('The null value was $verb.'));
677-
} else if (exception is num) {
675+
if (exception is num) {
678676
properties.add(ErrorDescription('The number $exception was $verb.'));
679677
} else {
680678
final DiagnosticsNode errorName;

packages/flutter/test/foundation/_compute_caller_unsound_null_safety.dart

-30
This file was deleted.

packages/flutter/test/foundation/_compute_caller_unsound_null_safety_error.dart

-22
This file was deleted.

packages/flutter/test/foundation/assertions_test.dart

-22
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,6 @@ void main() {
5858
'INFO\n'
5959
'═════════════════════════════════════════════════════════════════\n',
6060
);
61-
expect(
62-
FlutterErrorDetails(
63-
exception: NullThrownError(), // ignore: deprecated_member_use
64-
library: 'LIBRARY',
65-
context: ErrorDescription('CONTEXTING'),
66-
informationCollector: () sync* {
67-
yield ErrorDescription('INFO');
68-
},
69-
).toString(),
70-
'══╡ EXCEPTION CAUGHT BY LIBRARY ╞════════════════════════════════\n'
71-
'The null value was thrown CONTEXTING.\n'
72-
'\n'
73-
'INFO\n'
74-
'═════════════════════════════════════════════════════════════════\n',
75-
);
7661
expect(
7762
FlutterErrorDetails(
7863
exception: 'MESSAGE',
@@ -112,13 +97,6 @@ void main() {
11297
'MESSAGE\n'
11398
'═════════════════════════════════════════════════════════════════\n',
11499
);
115-
expect(
116-
// ignore: deprecated_member_use
117-
FlutterErrorDetails(exception: NullThrownError()).toString(),
118-
'══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞══════════════════════\n'
119-
'The null value was thrown.\n'
120-
'═════════════════════════════════════════════════════════════════\n',
121-
);
122100
});
123101

124102
test('FlutterErrorDetails.toStringShort', () {

packages/flutter/test/foundation/isolates_test.dart

-11
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,4 @@ void main() {
221221
'_compute_caller_invalid_message.dart');
222222
});
223223
}, skip: kIsWeb); // [intended] isn't supported on the web.
224-
225-
group('compute() works with unsound null safety caller', () {
226-
test('returning', () async {
227-
await expectFileSuccessfullyCompletes(
228-
'_compute_caller_unsound_null_safety.dart', true);
229-
});
230-
test('erroring', () async {
231-
await expectFileSuccessfullyCompletes(
232-
'_compute_caller_unsound_null_safety_error.dart', true);
233-
});
234-
}, skip: kIsWeb); // [intended] isn't supported on the web.
235224
}

0 commit comments

Comments
 (0)