FlutterError ShortcutRegistry in cascading_menu_page.dart in Context_Menus
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'.)
I found steps to constantly reproduce this issue:
- Run the flutter app in debug mode using vscode
- Select Cascading
- Right click to show the menu list
- Right click again
It seems to be some problem with the dispose method
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
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
Thanks for reporting and investigating the issue!
@justinmc Could you take a look at this issue and the proposed solution? I appreciate the help :)