NZDropDownMenu<T> class

NZDropDownMenu 是一个微信风格的下拉菜单组件。 它通常用于在导航栏或其他触发器下方显示一组操作或选项。 采用项目主色调 (NZColor.nezhaPrimary) 作为强调色。

Inheritance

Constructors

NZDropDownMenu({Key? key, required List<NZDropDownMenuItem<T>> items, T? value, ValueChanged<T?>? onChanged, String hint = '请选择', bool isExpanded = false, Color? backgroundColor, Color? textColor, Color? activeColor, NZDropDownMenuType type = NZDropDownMenuType.outline, NZDropDownMenuSize size = NZDropDownMenuSize.medium, double? borderRadius, double elevation = 8.0, double itemHeight = 48.0, double menuMaxHeight = 300.0, IconData? icon, bool showCheckIcon = true})
const

Properties

activeColor Color?
激活状态的颜色(主色调)
final
backgroundColor Color?
背景颜色
final
borderRadius double?
圆角半径
final
elevation double
菜单阴影高度
final
hashCode int
The hash code for this object.
no setterinherited
hint String
菜单触发器的占位文本
final
icon IconData?
右侧图标
final
isExpanded bool
是否展开
final
itemHeight double
选项高度
final
items List<NZDropDownMenuItem<T>>
菜单选项列表
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
菜单最大高度
final
onChanged ValueChanged<T?>?
选项改变时的回调
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCheckIcon bool
是否显示选中状态的打钩图标
final
size NZDropDownMenuSize
尺寸
final
textColor Color?
文本颜色
final
type NZDropDownMenuType
样式类型
final
value → T?
当前选中的值
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<NZDropDownMenu<T>>
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, 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