MSDropdownMenu class
A reusable dropdown-menu component that composes on WPopover.
The trigger child opens a popover panel containing the provided items.
Each item can carry an onTap callback, a disabled flag, and an optional
leading widget.
WPopover dismiss race note: the _suppressNextTapOutside guard in
WPopover handles the real-click dismiss race (wind/w_popover.dart
lines 231-240). The menu uses enableTriggerOnTap: true (WPopover's
default) so tapping the trigger reliably toggles the panel; the same-frame
outside-tap dismiss is suppressed internally by WPopover and does not need
any workaround here.
Example
MSDropdownMenu(
child: const WText('Options'),
items: [
MSDropdownMenuItem(label: 'Edit', onTap: controller.edit),
MSDropdownMenuItem(label: 'Delete', onTap: controller.delete),
],
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MSDropdownMenu
- Annotations
Constructors
-
MSDropdownMenu({Key? key, required Widget child, required List<
MSDropdownMenuItem> items, String? className, PopoverAlignment alignment = PopoverAlignment.bottomLeft}) -
Creates a MSDropdownMenu.
const
Properties
- alignment → PopoverAlignment
-
Popover alignment relative to the trigger.
Defaults to PopoverAlignment.bottomLeft.
final
- child → Widget
-
The trigger widget that opens/closes the menu.
final
- className → String?
-
Optional caller className appended after the panel recipe output.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
items
→ List<
MSDropdownMenuItem> -
The menu items to display in the popover panel.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited