Repository navigation
Cupertino ContextMenu improved onTap support #81057
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage teamp: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesf: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.c: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 26, 2021 umbrellait-andrey-sosnovyy commented
on Aug 25, 2022 More actionssame issue #70716
@cpboyd Did you come up with any workaround? I calling a package with a native iOS implementation, but it's very complicated.
- addedteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
on Jul 8, 2023 It looks like this was resolved by #131030. If this issue is still present, please file a new one with updated reproduction steps. Thank you!
This issue is still present, it is really evident when pushing a route because the overlay entry stays on top of the new route. To reproduce you have to hold the tap for a bit too long, but not long enough to trigger the context menu, see the third "tap" in the video.
Screen.Recording.2025-05-26.at.21.28.48.mov
Here is a sample code to reproduce this issue:
import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({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) => Scaffold( appBar: AppBar( title: Text('Other'), ), ); }
@LorTos please file a new issue with this reproduction and the output of
flutter doctor.This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on Jun 17, 2025
Use case
Many of the native iOS apps that support the
CupertinoContextMenuuse it on items that already have an existingonTapimplementation.Proposal
Currently,
CupertinoContextMenucan trigger while also triggeringonTapof the child element (depending on the exact duration of the tap) so it'd be nice to rework this such that a singleGestureDetectoris controlling both.