GlassMenuButton class

A glass button that opens a native iOS menu.

Items support roles and nested children (submenus). Without a title and with showChevron off it is a circular icon button, e.g. an overflow (ellipsis) menu. Falls back to a Material MenuAnchor.

GlassMenuButton(
  title: 'Sort',
  items: const [NativeItem(title: 'Name'), NativeItem(title: 'Date')],
  onSelected: (id) => debugPrint(id),
)
Inheritance

Constructors

GlassMenuButton({Key? key, required List<NativeItem> items, required ValueChanged<String> onSelected, String? title, NativeImage? icon, bool showChevron = true, bool prominent = true, double width = 220, double height = 52, NativeStyle? style, Widget? fallback})
Creates a glass menu button.
const

Properties

fallback → Widget?
Shown on platforms other than iOS. Defaults to a Material MenuAnchor.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
Height of the native view.
final
icon → NativeImage?
Optional leading icon.
final
items → List<NativeItem>
Menu entries.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSelected → ValueChanged<String>
Called with the id of the chosen entry (NativeItem.id, or its title).
final
prominent → bool
Filled (.glassProminent) instead of clear glass.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showChevron → bool
Show a chevron after the title.
final
style → NativeStyle?
Appearance. Tint and color scheme default to the app's Theme.
final
title → String?
Button text.
final
width → double
Width of the native view. Platform views cannot size themselves, so pick one that fits the title.
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.
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