SpinnerItemData class
继承 ChangeNotifier
ValueListenable
写入自变量 selected
,方便监听点击选中状态
- Inheritance
-
- Object
- ChangeNotifier
- SpinnerItemData
- Implemented types
Constructors
-
SpinnerItemData({String name = '-', dynamic result, bool isMutex = false, List<
SpinnerItemData> items = const [], bool selected = false}) -
SpinnerItemData.fromJson(Map<
String, dynamic> json) -
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isMutex → bool
-
是否选互斥(选中时清空当前其他选中项,一般用于
全部
不限
等合并条件项)final - isSelectedAll → bool
-
带有子集选项时,判断当前选项的子选项是否全部选中
no setter
-
items
→ List<
SpinnerItemData> -
下级选项
final
- name → String
-
显示名称
final
- result → dynamic
-
选中项的数据值 (原样输入输出)
如果数据类型与实际类型不匹配时,可将实际数据放入
result
中 以保证选中时输出实际类容的集合final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected ↔ bool
-
高亮(栅栏选中时,需要切换数据)
选中状态
getter/setter pair
- value ↔ bool
-
不对外使用
外部使用
selected
isHighlight
替代getter/setter pairoverride-getter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
copyWith(
{String? name, dynamic result, bool? selected, bool? isMutex, List< SpinnerItemData> ? items}) → SpinnerItemData -
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited