How to register app-global actions in flutter using Shortcuts/Intent/Actions?

281 Views Asked by At

Using the Shortcuts and Actions widget it is easy to add actions which are invoked while the focus is below the actual Actions widget.

But in my use case I have a master/detail view layout where I want the master view handle shortcuts (like 'next item'/'previous item') even if the detail view is in focus. (and potentially the other way around, I want the detail view to handle shortcuts while the master view has focus).

The only workaround I found was to create an action on the root level on which the master and detail view can listen - but this feels like it circumvents the whole Shortcuts/Intent/Action framework.

So is there a way to have the Actions registered at the root of the app, instead of at the specific context location inside the focus tree?


To be a bit more specific:

AuthPass screenshot with master/detail view

the "master view" is the list of password entries, while the "detail view" gives the fields/information about the password. Even if the focus is on the list view the CopyPasswordIntent should be handled by the detail view, while even when the user has the focus in the detail view a SearchIntent should always revert the focus back to the list view's search field.

0

There are 0 best solutions below