Closed LinHaoLove closed 1 year ago
i put a DropDownButton to content of TreeViewItem,and put text widget with gestures to buttonBuilder of DropDownButton. that is ok!
I keep this one open, I'm also interested to have a secondary tap on TreeViewIteams.
I have designed a concept for this. Each TreeViewItem
will have a gestures
parameter that will take a <Type, GestureRecognizerFactory>
map. In the implementation (_TreeViewItem
), a the parameter will be passed into a RawGesturesDetector
To use, it'd be something like:
items: [
TreeViewItem(
...,
gestures: {
TapGestureRecognizer: GestureRecognizerFactoryWithHandlers<TapGestureRecognizer>(
() => TapGestureRecognizer(),
(TapGestureRecognizer instance) {
instance
..onTapDown = (details) {}
..onSecondaryTap = () {};
},
),
},
),
],
The records:
TreeViewItem
, so this is a viable solution;TreeViewItem
. This means we wouldn't have such thing as TreeView.onSecondaryTap(details, item)
, that would be invoked for every item;onTap
, onSecondaryTap
, onLongPress
) - with no further customization -, or we can provide this option with GestureRecognizerFactory
This would be a nice feature!
From the point of view of a user, when I see some tree-like element in a desktop app GUI, I would try out these gestures:
In a mobile application I would try out:
Long story short: I think onTap
, onDoubleTap
, onSecondaryTap
and onLongPress
should be available by default to cover the most common interactions of a user with a tree view.
Is your feature request related to a problem? Please describe.
i need show menu for every treeViewItem on windows and macos,by "onSecondaryTap". i need show menu for every treeViewItem on android and ios,by "onLongPress" or "other gestures"
Describe the solution you'd like
return TreeView( selectionMode: TreeViewSelectionMode.single, items: [...], onSecondaryTap: (TreeViewItem item, TapDownDetails details,){ print('onSecondaryTap'); }, onLongPress: (TreeViewItem item){ print('onLongPress'); }, onOtherGestures: (TreeViewItem item){ print('Other Gestures'); }, );