-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Close CupertinoContextMenu overlay if the widget is disposed or a new route is pushed #170186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
|
||
// Kickstart the route transition. | ||
await tester.pump(); | ||
await tester.pump(const Duration(milliseconds: 300)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this duration dependent on the duration of the route transition? FYI I am working on figuring out a way to dynamically get this value in tests, see #165832 (comment). Probably no action to take on this PR, but just a heads up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but 👍
…d or a new route is pushed (flutter/flutter#170186)
…d or a new route is pushed (flutter/flutter#170186)
…d or a new route is pushed (flutter/flutter#170186)
…d or a new route is pushed (flutter/flutter#170186)
…d or a new route is pushed (flutter/flutter#170186)
flutter/flutter@c7362b4...0ab008a 2025-06-22 engine-flutter-autoroll@skia.org Roll Skia from 203469ef4672 to fcd1c55da9cc (1 revision) (flutter/flutter#170986) 2025-06-22 engine-flutter-autoroll@skia.org Roll Dart SDK from e5db5e0f81ba to 98db1db5ff65 (2 revisions) (flutter/flutter#170979) 2025-06-21 bruno.leroux@gmail.com Normalize input decoration theme (flutter/flutter#168981) 2025-06-21 engine-flutter-autoroll@skia.org Roll Skia from dceb857b1c47 to 203469ef4672 (1 revision) (flutter/flutter#170959) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from 6325aeacaef4 to e5db5e0f81ba (1 revision) (flutter/flutter#170958) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from a6a3d65e33d7 to 6325aeacaef4 (2 revisions) (flutter/flutter#170955) 2025-06-21 engine-flutter-autoroll@skia.org Roll Skia from 773188560221 to dceb857b1c47 (1 revision) (flutter/flutter#170954) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from 750eaa028445 to a6a3d65e33d7 (1 revision) (flutter/flutter#170953) 2025-06-21 hidea@users.noreply.github.com Fix the Japanese IME problem on macOS reported in the following issue. (flutter/flutter#166291) 2025-06-21 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from IfPORaYjQ2zP4bcq-... to 2wEtX_lDNhHhDNsP6... (flutter/flutter#170946) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from 104460420c48 to 773188560221 (2 revisions) (flutter/flutter#170942) 2025-06-20 huy@nevercode.io Normalize AppBarTheme (flutter/flutter#169130) 2025-06-20 victorsanniay@gmail.com Close CupertinoContextMenu overlay if the widget is disposed or a new route is pushed (flutter/flutter#170186) 2025-06-20 engine-flutter-autoroll@skia.org Roll Dart SDK from a554bdd0a2cc to 750eaa028445 (1 revision) (flutter/flutter#170933) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from b638003de37e to 104460420c48 (1 revision) (flutter/flutter#170932) 2025-06-20 engine-flutter-autoroll@skia.org Roll Packages from 0ec4053 to 7f41e75 (1 revision) (flutter/flutter#170925) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from f1e68950ea7b to b638003de37e (5 revisions) (flutter/flutter#170923) 2025-06-20 30870216+gaaclarke@users.noreply.github.com [licenses_cpp] jun17 (flutter/flutter#170845) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#9472) flutter/flutter@c7362b4...0ab008a 2025-06-22 engine-flutter-autoroll@skia.org Roll Skia from 203469ef4672 to fcd1c55da9cc (1 revision) (flutter/flutter#170986) 2025-06-22 engine-flutter-autoroll@skia.org Roll Dart SDK from e5db5e0f81ba to 98db1db5ff65 (2 revisions) (flutter/flutter#170979) 2025-06-21 bruno.leroux@gmail.com Normalize input decoration theme (flutter/flutter#168981) 2025-06-21 engine-flutter-autoroll@skia.org Roll Skia from dceb857b1c47 to 203469ef4672 (1 revision) (flutter/flutter#170959) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from 6325aeacaef4 to e5db5e0f81ba (1 revision) (flutter/flutter#170958) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from a6a3d65e33d7 to 6325aeacaef4 (2 revisions) (flutter/flutter#170955) 2025-06-21 engine-flutter-autoroll@skia.org Roll Skia from 773188560221 to dceb857b1c47 (1 revision) (flutter/flutter#170954) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from 750eaa028445 to a6a3d65e33d7 (1 revision) (flutter/flutter#170953) 2025-06-21 hidea@users.noreply.github.com Fix the Japanese IME problem on macOS reported in the following issue. (flutter/flutter#166291) 2025-06-21 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from IfPORaYjQ2zP4bcq-... to 2wEtX_lDNhHhDNsP6... (flutter/flutter#170946) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from 104460420c48 to 773188560221 (2 revisions) (flutter/flutter#170942) 2025-06-20 huy@nevercode.io Normalize AppBarTheme (flutter/flutter#169130) 2025-06-20 victorsanniay@gmail.com Close CupertinoContextMenu overlay if the widget is disposed or a new route is pushed (flutter/flutter#170186) 2025-06-20 engine-flutter-autoroll@skia.org Roll Dart SDK from a554bdd0a2cc to 750eaa028445 (1 revision) (flutter/flutter#170933) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from b638003de37e to 104460420c48 (1 revision) (flutter/flutter#170932) 2025-06-20 engine-flutter-autoroll@skia.org Roll Packages from 0ec4053 to 7f41e75 (1 revision) (flutter/flutter#170925) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from f1e68950ea7b to b638003de37e (5 revisions) (flutter/flutter#170923) 2025-06-20 30870216+gaaclarke@users.noreply.github.com [licenses_cpp] jun17 (flutter/flutter#170845) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
… route is pushed (flutter#170186) Fixes [CupertinoContextMenu potential unremoved overlay entry](flutter#131471) Fixes [CupertinoContextMenu onTap gesture interferes with child widget with onTap GestureRecognizer](flutter#169911) <details> <summary>Sample code</summary> ```dart import 'dart:async'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; bool ctxMenuRemoved = false; class ContextMenuApp extends StatelessWidget { const ContextMenuApp({super.key}); @OverRide Widget build(BuildContext context) { final colorScheme = ColorScheme.fromSeed(seedColor: Colors.orange); return MaterialApp( theme: ThemeData( colorScheme: colorScheme, appBarTheme: AppBarTheme(backgroundColor: colorScheme.secondaryContainer), ), home: const HomePage(), ); } } class HomePage extends StatelessWidget { const HomePage({super.key}); @OverRide Widget build(BuildContext context) => Scaffold( appBar: AppBar( title: Text('Home'), ), body: Center( child: CupertinoContextMenu( actions: [ CupertinoContextMenuAction( child: Text('Test'), ), ], child: GestureDetector( onTap: () { Navigator.of(context).push( MaterialPageRoute(builder: (context) => _OtherPage()), ); }, child: Container( color: Colors.orange, height: 100, width: 100, ), ), ), ), ); } class _OtherPage extends StatelessWidget { const _OtherPage({super.key}); @OverRide Widget build(BuildContext context) { return Scaffold( body: Align( child: Builder(builder: (context) { return Listener( onPointerDown: (_) { Timer(const Duration(milliseconds: 480), () { ctxMenuRemoved = true; (context as Element).markNeedsBuild(); }); }, child: ctxMenuRemoved ? const SizedBox() : CupertinoContextMenu( actions: [ CupertinoContextMenuAction( child: const Text('Action one'), onPressed: () {}, ), ], child: Container( height: 100, width: 100, color: Colors.black45, ), ), ); }), ), ); } } ``` </details>
…r#9472) flutter/flutter@c7362b4...0ab008a 2025-06-22 engine-flutter-autoroll@skia.org Roll Skia from 203469ef4672 to fcd1c55da9cc (1 revision) (flutter/flutter#170986) 2025-06-22 engine-flutter-autoroll@skia.org Roll Dart SDK from e5db5e0f81ba to 98db1db5ff65 (2 revisions) (flutter/flutter#170979) 2025-06-21 bruno.leroux@gmail.com Normalize input decoration theme (flutter/flutter#168981) 2025-06-21 engine-flutter-autoroll@skia.org Roll Skia from dceb857b1c47 to 203469ef4672 (1 revision) (flutter/flutter#170959) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from 6325aeacaef4 to e5db5e0f81ba (1 revision) (flutter/flutter#170958) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from a6a3d65e33d7 to 6325aeacaef4 (2 revisions) (flutter/flutter#170955) 2025-06-21 engine-flutter-autoroll@skia.org Roll Skia from 773188560221 to dceb857b1c47 (1 revision) (flutter/flutter#170954) 2025-06-21 engine-flutter-autoroll@skia.org Roll Dart SDK from 750eaa028445 to a6a3d65e33d7 (1 revision) (flutter/flutter#170953) 2025-06-21 hidea@users.noreply.github.com Fix the Japanese IME problem on macOS reported in the following issue. (flutter/flutter#166291) 2025-06-21 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from IfPORaYjQ2zP4bcq-... to 2wEtX_lDNhHhDNsP6... (flutter/flutter#170946) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from 104460420c48 to 773188560221 (2 revisions) (flutter/flutter#170942) 2025-06-20 huy@nevercode.io Normalize AppBarTheme (flutter/flutter#169130) 2025-06-20 victorsanniay@gmail.com Close CupertinoContextMenu overlay if the widget is disposed or a new route is pushed (flutter/flutter#170186) 2025-06-20 engine-flutter-autoroll@skia.org Roll Dart SDK from a554bdd0a2cc to 750eaa028445 (1 revision) (flutter/flutter#170933) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from b638003de37e to 104460420c48 (1 revision) (flutter/flutter#170932) 2025-06-20 engine-flutter-autoroll@skia.org Roll Packages from 0ec4053 to 7f41e75 (1 revision) (flutter/flutter#170925) 2025-06-20 engine-flutter-autoroll@skia.org Roll Skia from f1e68950ea7b to b638003de37e (5 revisions) (flutter/flutter#170923) 2025-06-20 30870216+gaaclarke@users.noreply.github.com [licenses_cpp] jun17 (flutter/flutter#170845) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…d or a new route is pushed (flutter/flutter#170186)
…d or a new route is pushed (flutter/flutter#170186)
…d or a new route is pushed (flutter/flutter#170186)
…d or a new route is pushed (flutter/flutter#170186)
…d or a new route is pushed (flutter/flutter#170186)
Fixes CupertinoContextMenu potential unremoved overlay entry
Fixes CupertinoContextMenu onTap gesture interferes with child widget with onTap GestureRecognizer
Sample code