Skip to content

Commit acbfb40

Browse files
authored
Handle null return from WillPopCallback (#127039)
Partial revert of flutter/flutter#126647 to work around issue in google3. See b/283046390
1 parent c08b9ac commit acbfb40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/flutter/lib/src/widgets/routes.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,9 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
14991499
final _ModalScopeState<T>? scope = _scopeKey.currentState;
15001500
assert(scope != null);
15011501
for (final WillPopCallback callback in List<WillPopCallback>.of(_willPopCallbacks)) {
1502-
if (!await callback()) {
1502+
// TODO(goderbauer): Tests using the Component Framework in google3 insist on returning
1503+
// null for mocked out WillPopCallbacks. Fix that to remove ignore.
1504+
if (await callback() != true) { // ignore: no_literal_bool_comparisons
15031505
return RoutePopDisposition.doNotPop;
15041506
}
15051507
}

0 commit comments

Comments
 (0)