Revert "Handle null return from WillPopCallback" (#127112)

Reverts flutter/flutter#127039

Google3 has been fixed, so this work around is no longe necessary.
This commit is contained in:
Michael Goderbauer 2023-05-18 10:47:54 -07:00 committed by GitHub
parent 2b95fa67a7
commit 5ae6438157
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1499,9 +1499,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
final _ModalScopeState<T>? scope = _scopeKey.currentState;
assert(scope != null);
for (final WillPopCallback callback in List<WillPopCallback>.of(_willPopCallbacks)) {
// TODO(goderbauer): Tests using the Component Framework in google3 insist on returning
// null for mocked out WillPopCallbacks. Fix that to remove ignore.
if (await callback() != true) { // ignore: no_literal_bool_comparisons
if (!await callback()) {
return RoutePopDisposition.doNotPop;
}
}