MoonMenuItem class

Inheritance

Constructors

MoonMenuItem({Key? key, CrossAxisAlignment? menuItemCrossAxisAlignment, CrossAxisAlignment? labelAndContentCrossAxisAlignment, bool absorbGestures = false, bool autofocus = false, BorderRadiusGeometry? borderRadius, Color? backgroundColor, Color? hoverEffectColor, Decoration? decoration, double? height, double? width, double? horizontalGap, double? verticalGap, Duration? hoverEffectDuration, Curve? hoverEffectCurve, EdgeInsetsGeometry? menuItemPadding, FocusNode? focusNode, String? semanticLabel, VoidCallback? onTap, Widget? leading, required Widget label, Widget? content, Widget? trailing})
Creates a Moon Design menu item.
const

Properties

absorbGestures bool
Whether the menu item should absorb gestures. If this is true the menu item children will not receive gestures.
final
autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
backgroundColor Color?
The background color of the menu item.
final
borderRadius BorderRadiusGeometry?
The border radius of the menu item.
final
content Widget?
The widget to display below the label widget of the menu item. The secondary content of the menu item header.
final
decoration Decoration?
The custom decoration of the menu item.
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The height of the menu item.
final
horizontalGap double?
The horizontal gap between the leading, label and trailing widgets of the menu item.
final
hoverEffectColor Color?
The color of the menu item hover effect.
final
hoverEffectCurve Curve?
The curve of the menu item hover effect.
final
hoverEffectDuration Duration?
The duration of the menu item hover effect.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label Widget
The primary content of the menu item header.
final
labelAndContentCrossAxisAlignment CrossAxisAlignment?
Defines how the label and content widgets of the menu item are aligned along the cross axis within label and content slots.
final
leading Widget?
The widget to display before the label widget of the menu item.
final
Defines how the widgets of the menu item are aligned along the cross axis.
final
The padding of the menu item.
final
onTap VoidCallback?
The callback that is called when the menu item is tapped or pressed. Null value disables the menu item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
The semantic label for the menu item.
final
trailing Widget?
The widget to display after the label widget of the menu item.
final
verticalGap double?
The vertical gap between the label and content widgets of the menu item.
final
width double?
The width of the menu item.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MoonMenuItem>
Creates the mutable state for this widget at a given location in the tree.
override
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}) 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

Static Methods

divideMenuItems({required BuildContext context, required Iterable<Widget> menuItems, Color? color, double? width}) Iterable<Widget>