pub struct PopupMenuItemData<T> {
pub key: Option<KeyRef>,
pub value: Option<T>,
pub on_tap: Option<Listener>,
pub enabled: bool,
pub height: f64,
pub padding: Option<EdgeInsets>,
pub text_style: Option<TextStyle>,
pub label_text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>,
pub mouse_cursor: Option<MouseCursorRef>,
pub child: Option<WidgetRef>,
}Expand description
The fields of Dart’s PopupMenuItem<T>, which PopupMenuItem and its subclasses, such
as CheckedPopupMenuItem, carry under the field popup_menu_item.
Fields§
§key: Option<KeyRef>§value: Option<T>The value that will be returned by ShowMenu if this entry is selected.
on_tap: Option<Listener>Called when the menu item is tapped.
enabled: boolWhether the user is permitted to select this item.
Defaults to true. If this is false, then the item will not react to touches.
height: f64The minimum height of the menu item.
Defaults to K_MIN_INTERACTIVE_DIMENSION pixels.
padding: Option<EdgeInsets>The padding of the menu item.
The height property may interact with the applied padding. For
example, If a height greater than the height of the sum of the padding
and child is provided, then the padding’s effect will not be visible.
If this is None and ThemeData::use_material3 is true, the horizontal padding
defaults to 12.0 on both sides.
If this is None and ThemeData::use_material3 is false, the horizontal padding
defaults to 16.0 on both sides.
text_style: Option<TextStyle>The text style of the popup menu item.
If this property is None, then PopupMenuThemeData::text_style is used. If
PopupMenuThemeData::text_style is also None, then TextTheme::title_medium of
ThemeData::text_theme is used.
label_text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>The label style of the popup menu item.
When ThemeData::use_material3 is true, this styles the text of the popup menu item.
If this property is None, then PopupMenuThemeData::label_text_style is used. If
PopupMenuThemeData::label_text_style is also None, then TextTheme::label_large
is used with the ColorScheme::on_surface color when popup menu item is enabled and the
ColorScheme::on_surface color with 0.38 opacity when the popup menu item is disabled.
mouse_cursor: Option<MouseCursorRef>{@template material_ui.popupmenu.mouseCursor} The cursor for a mouse pointer when it enters or is hovering over the widget.
If mouse_cursor is a WidgetStateMouseCursor,
WidgetStateProperty::resolve is used for the following WidgetStates:
{@endtemplate}
If None, then the value of PopupMenuThemeData::mouse_cursor is used. If that is
also None, then WidgetStateMouseCursor::adaptive_clickable is used.
child: Option<WidgetRef>The widget below this widget in the tree.
Typically a single-line ListTile (for menus with icons) or a Text. An appropriate
DefaultTextStyle is put in scope for the child. In either case, the text should be
short enough that it won’t wrap.
Implementations§
Source§impl<T> PopupMenuItemData<T>
impl<T> PopupMenuItemData<T>
Sourcepub fn new(child: Option<WidgetRef>) -> PopupMenuItemData<T>
pub fn new(child: Option<WidgetRef>) -> PopupMenuItemData<T>
The fields of an item showing child, with Dart’s defaults.