Fluent2MenuButton class

Fluent 2's MenuButton: a Fluent2Button whose words end in the down chevron, saying it opens a menu; onPressed opens it (a Fluent2Menu).

Fluent2MenuButton('Sort', icon: Fluent2Icons.arrowSort, onPressed: () => Fluent2Menu.show(context, items: sorts))
Inheritance

Constructors

Fluent2MenuButton(String label, {required VoidCallback? onPressed, Fluent2ButtonAppearance appearance = Fluent2ButtonAppearance.secondary, Fluent2ButtonSize size = Fluent2ButtonSize.medium, IconData? icon, Fluent2Style? style, FocusNode? focusNode, bool autofocus = false, Key? key})
A button labelled label with a chevron that opens a menu.
const

Properties

appearance → Fluent2ButtonAppearance
Fluent's appearance: which of its faces it wears.
final
autofocus → bool
Whether the control takes focus when it first builds.
final
focusNode → FocusNode?
The control's focus node; null makes and disposes its own.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → IconData?
The glyph before label; null shows none.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label → String
The words on its face.
final
onPressed → VoidCallback?
Called when it is pressed; null puts it out of use.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → Fluent2ButtonSize
Fluent's size: how large it is drawn.
final
style → Fluent2Style?
This button's own look, slot by slot, over its appearance's theme.
final

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.
override
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