Skip to content

Commit

Permalink
Handle null return from WillPopCallback (#127039)
Browse files Browse the repository at this point in the history
Partial revert of flutter/flutter#126647 to work around issue in google3.

See b/283046390
  • Loading branch information
goderbauer authored May 17, 2023
1 parent c08b9ac commit acbfb40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/flutter/lib/src/widgets/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,9 @@ 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)) {
if (!await callback()) {
// 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
return RoutePopDisposition.doNotPop;
}
}
Expand Down

0 comments on commit acbfb40

Please sign in to comment.