DropdownList class
DropdownList( items: ListItem(value: "1", text: '选项1'), ListItem(text: "选项2", value: "2"), , width: 200, title: "标题", submitText: "确定", isPreSelect: true, isMultiSelect: true, hintText: "请选择 ", leastSelectHintText: "至少选择一项", buttonBackgroundColors: const Color(0xff1afa29), Color(0xff1afa29), buttonIconColor: Colors.white, selectCall: (List
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DropdownList
Constructors
-
DropdownList({Key? key, double? width, double height = 38, Color borderColor = const Color(0x60e4e4e4), double borderWidth = 0, BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4)), BorderRadius dialogBorderRadius = const BorderRadius.only(topLeft: Radius.circular(4), topRight: Radius.circular(4)), Color backgroundColor = Colors.white, List<
Color> buttonBackgroundColors = const [Color(0xff1afa29), Color(0xff1afa29)], List<Color> buttonDisableBackgroundColors = const [Color(0x661afa29), Color(0x661afa29)], Color buttonIconColor = const Color(0x99333333), Color dialogBackgroundColor = Colors.white, required List<ListItem> items, String? title, Color? titleColor, double? titleSize, Widget? submit, String? submitText, Color? submitTextColor, double? submitTextSize, BorderRadiusGeometry submitBorderRadius = const BorderRadius.all(Radius.circular(5)), Color? submitBackgroundColor, bool isPreSelect = true, bool isMultiSelect = false, required dynamic selectCall(List<ListItem> selectItems), String hintText = "", String leastSelectHintText = "", String defaultValue = "", dynamic buildCall(DropdownListController controller)?, bool enable = true, EdgeInsetsGeometry padding = const EdgeInsets.only(left: 6, right: 4), AlignmentGeometry alignment = Alignment.center, FontWeight? fontWeight, Color? listSplitLineColor, double itemHeight = 42, double? itemTextSize, Color? itemTextColor, Widget? multiSelectIcon, Widget? multiUnSelectIcon, Widget? singleSelectIcon, Widget? singleUnSelectIcon, IconData? buttonArrowUpIcon, IconData? buttonArrowDownIcon}) -
const
Properties
- alignment → AlignmentGeometry
-
文本对齐方式
final
- backgroundColor → Color
-
组件背景颜色
final
- borderColor → Color
-
边框颜色
final
- borderRadius → BorderRadius
-
边框圆角
final
- borderWidth → double
-
边框宽度
final
- buildCall → dynamic Function(DropdownListController controller)?
-
构建完成后回传控制器
final
-
final
-
button向上剪头icon
final
-
按钮背景颜色
final
-
按钮禁用状态背景颜色
final
-
按钮图标颜色
final
- defaultValue → String
-
默认值
final
- dialogBackgroundColor → Color
-
弹窗面板背景
final
- dialogBorderRadius → BorderRadius
-
弹窗面板圆角
final
- enable → bool
-
是否启用
final
- fontWeight → FontWeight?
-
文本加粗方式
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
组件高度
final
- hintText → String
-
提示文本
final
- isMultiSelect → bool
-
仅在isPreSelect=true时有效
true-多选;false-单选;
final
- isPreSelect → bool
-
true-选择后需要由确认完成;false-选择直接完成;
final
- itemHeight → double
-
列表项高度
final
-
items
→ List<
ListItem> -
菜单项
final
- itemTextColor → Color?
-
列表文本颜色
final
- itemTextSize → double?
-
列表文本大小
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leastSelectHintText → String
-
至少选择提示文本
final
- listSplitLineColor → Color?
-
列表分割线颜色
final
- multiSelectIcon → Widget?
-
多选选中图标
final
- multiUnSelectIcon → Widget?
-
多选未选中图标
final
- padding → EdgeInsetsGeometry
-
显示文本内边距
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectCall
→ dynamic Function(List<
ListItem> selectItems) -
选择回调
selectItems
选择项final - singleSelectIcon → Widget?
-
单选选中图标
final
- singleUnSelectIcon → Widget?
-
单选未选中图标
final
- submit → Widget?
-
提交按钮
final
- submitBackgroundColor → Color?
-
提交按钮背景颜色
final
- submitBorderRadius → BorderRadiusGeometry
-
提交按钮边框圆角
final
- submitText → String?
-
提交按钮文本与submit互斥
final
- submitTextColor → Color?
-
提交按钮文本颜色
final
- submitTextSize → double?
-
提交按钮文本大小
final
- title → String?
-
选择组件显示标题
final
- titleColor → Color?
-
标题颜色
final
- titleSize → double?
-
标题大小
final
- width → double?
-
组件宽度
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _DropdownListState -
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