Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/dropdown_button2/lib/src/dropdown_menu_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class DropdownItem<T> extends _DropdownMenuItemContainer {
super.intrinsicHeight,
super.alignment,
this.onTap,
this.onLongPress,
this.value,
this.enabled = true,
this.closeOnTap = true,
Expand All @@ -23,6 +24,9 @@ class DropdownItem<T> extends _DropdownMenuItemContainer {
/// Called when the dropdown menu item is tapped.
final VoidCallback? onTap;

/// Called when the dropdown menu item is long pressed.
final VoidCallback? onLongPress;

/// The value to return if the user selects this menu item.
///
/// Eventually returned in a call to [DropdownButton.onChanged].
Expand Down Expand Up @@ -223,6 +227,7 @@ class _DropdownItemButtonState<T> extends State<_DropdownItemButton<T>> {
autofocus: isSelectedItem,
enableFeedback: widget.enableFeedback,
onTap: _handleOnTap,
onLongPress: dropdownItem.onLongPress,
onFocusChange: _handleFocusChange,
borderRadius: menuItemStyle.borderRadius,
overlayColor: menuItemStyle.overlayColor,
Expand Down