Traversing Flutter widget tree

83 views
Skip to first unread message

Chris Norman

unread,
Aug 9, 2022, 5:09:10 PM8/9/22
to mi...@dartlang.org
Hi all,
I've got a widget which I'm using to display a list of possible shortcuts when the user presses the question mark. Only trouble is, I can't figure out how to get all the shortcuts from further up the tree. This means that if a `WithKeyboardShortcuts` widget is pushed, then another on top, only the top-most shortcuts are shown, rather than combining the shortcuts from both widgets, which is what I'd like to achieve.

Is there a way to walk the widget tree and find other instances? I've tried using the BuildContext.findAncestorWidgetOfExactType method, but with no luck.

Thanks in advance.

Take care,

Chris Norman

Reply all
Reply to author
Forward
0 new messages