Skip to content

FlutterError ShortcutRegistry in cascading_menu_page.dart in Context_Menus #2590

Description

@RequieMa

Exception has occurred.
FlutterError (ShortcutRegistry: Received a duplicate registration for the shortcut SingleActivator#39312(keys: Control + Key S) in ShortcutRegistryEntry#64d8f and Instance of 'ShortcutRegistryEntry'.)

Image

Activity

  1. RequieMa commented on Feb 24, 2025

    @RequieMa
    Author

    I found steps to constantly reproduce this issue:

    1. Run the flutter app in debug mode using vscode
    2. Select Cascading
    3. Right click to show the menu list
    4. Right click again

    It seems to be some problem with the dispose method
    Image
    with the original code, if I right clicked twice, the ShortcutRegistry.of(context) did not dispose properly, and the same shortcuts were added again. That caused the problem

    Image
    If I verify the length before adding the shortcuts, the problem solved. However, it seems to be a workaround, I did not understand why the dispose did not work properly.

    What do you think about this solution? If it is good enough, I will push a merge request

  2. parlough commented on Feb 24, 2025

    @parlough
    Member

    Thanks for reporting and investigating the issue!

    @justinmc Could you take a look at this issue and the proposed solution? I appreciate the help :)

  3. ericwindmill commented on Apr 15, 2026

    @ericwindmill
    Collaborator

    This sample has been deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions