AppMenu<T> class
Create a customized PopupMenuButton.
Constructors
-
AppMenu({Key? key, List<
T> ? items, PopupMenuItemBuilder<T> ? itemBuilder, T? initialValue, PopupMenuItemSelected<T> ? onSelected, PopupMenuCanceled? onCanceled, String? tooltip, double? elevation, EdgeInsetsGeometry? padding, Widget? child, double? splashRadius, Widget? icon, double? iconSize, Offset? offset, bool? enabled, ShapeBorder? shape, Color? color, bool? enableFeedback, BoxConstraints? constraints, PopupMenuPosition? position}) - Supply all the properties to instantiate a custom PopupMenuButton.
Properties
- child ↔ Widget?
-
If provided, child is the widget used for this button
getter/setter pair
- color ↔ Color?
-
If provided, the background color used for the menu.
getter/setter pair
- constraints ↔ BoxConstraints?
-
Optional size constraints for the menu.
getter/setter pair
- context → BuildContext?
-
BuildContext objects are actually Element objects. The BuildContext
interface is used to discourage direct manipulation of Element objects.
no setter
- elevation ↔ double?
-
The z-coordinate at which to place the menu when open. This controls the
size of the shadow below the menu.
getter/setter pair
- enabled ↔ bool?
-
Whether this popup menu button is interactive.
getter/setter pair
- enableFeedback ↔ bool?
-
Whether detected gestures should provide acoustic and/or haptic feedback.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon ↔ Widget?
-
If provided, the icon is used for this button
getter/setter pair
- iconSize ↔ double?
-
If provided, the size of the Icon.
getter/setter pair
- initialValue ↔ T?
-
The value of the menu item, if any, that should be highlighted when the menu opens.
getter/setter pair
-
itemBuilder
↔ PopupMenuItemBuilder<
T> ? -
The item builder if no List is available.
getter/setter pair
-
items
↔ List<
T> ? -
Optional list of menu items to appear in the popup menu.
getter/setter pair
- key ↔ Key?
-
Key to the PopupMenuButton
getter/setter pair
-
Optional list of PopupMenuEntries to appear in the popup menu.
getter/setter pair
-
override in subclass
no setter
- offset ↔ Offset?
-
The offset applied to the Popup Menu Button.
getter/setter pair
- onCanceled ↔ PopupMenuCanceled?
-
Called when the user dismisses the popup menu without selecting an item.
getter/setter pair
-
onSelected
↔ PopupMenuItemSelected<
T> ? -
Called when a menu item is selected.
getter/setter pair
- padding ↔ EdgeInsetsGeometry?
-
Matches IconButton's 8 dps padding by default. In some cases, notably where
this button appears as the trailing element of a list item, it's useful to be able
to set the padding to zero.
getter/setter pair
- popupMenuButton → Widget
-
Return the state object with the name, button.
no setter
- position ↔ PopupMenuPosition?
-
Whether the popup menu is positioned over or under the popup menu button.
Either PopupMenuPosition.over or PopupMenuPosition.under
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape ↔ ShapeBorder?
-
If provided, the shape used for the menu.
getter/setter pair
- splashRadius ↔ double?
-
The splash radius.If null, default splash radius of InkWell or IconButton is used.
getter/setter pair
- tooltip ↔ String?
-
Text that describes the action that will occur when the button is pressed.
getter/setter pair
Methods
-
canceled(
) → void -
Called when the user dismisses the popup menu without selecting an item.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onChild(
) → Widget? -
The widget used for this button
inherited
-
onColor(
) → Color? -
The background color used for the menu
inherited
-
onConstraints(
) → BoxConstraints? -
Make the menu wider than the default maximum width
inherited
-
onElevation(
) → double? -
This controls the size of the shadow below the menu.
inherited
-
onEnabled(
) → bool? -
Whether this popup menu button is interactive
inherited
-
onEnableFeedback(
) → bool? -
Whether detected gestures should provide acoustic and/or haptic feedback
inherited
-
onIcon(
) → Widget? -
The icon is used for this button
inherited
-
onIconSize(
) → double? -
the size of the Icon.
inherited
-
onInitialValue(
) → T? -
The value of the menu item, if any, that should be highlighted when the menu opens.
inherited
-
onItems(
) → List< T> ? -
List of menu items to appear in the popup menu.
inherited
-
onOffset(
) → Offset? -
The offset is applied relative to the initial position
inherited
-
onPadding(
) → EdgeInsetsGeometry? -
In some cases, it's useful to be able to set the padding to zero.
inherited
-
onPosition(
) → PopupMenuPosition? -
Whether the menu is positioned over or under the popup menu button
inherited
-
onShape(
) → ShapeBorder? -
The shape used for the menu
inherited
-
onSplashRadius(
) → double? -
The splash radius. If null, default splash radius of InkWell or IconButton is used.
inherited
-
onTooltip(
) → String? -
Text that describes the action that will occur when the button is pressed.
inherited
-
selected(
T value) → void -
Called when the user selects a value from the popup menu created by this button.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited