S2Choice<T> class

Choice data configuration

Mixed in types
Annotations

Constructors

S2Choice({required T value, required String? title, String? subtitle, String? group, bool disabled = false, bool hidden = false, dynamic meta, S2ChoiceStyle? style, S2ChoiceStyle? activeStyle, ValueSetter<bool?>? select, bool selected = false})
Default constructor

Properties

activeStyle S2ChoiceStyle?
Individual selected choice item style
final
disabled bool
Whether the choice is disabled or enabled
final
effectiveStyle S2ChoiceStyle?
no setter
group String?
The choice will grouped by this property value
final
hashCode int
The hash code for this object.
no setteroverride
hidden bool
Whether the choice is displayed or not
final
meta → dynamic
This prop is useful for choice builder
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
select ValueSetter<bool?>?
Callback to select choice
final
selected bool
Whether the choice is selected or not
final
style S2ChoiceStyle?
Individual unselected choice item style
final
subtitle String?
Represent as secondary text
final
title String?
Represent as primary text
final
value → T
Value to return
final

Methods

contains(String query) bool
copyWith({T? value, String? title, String? subtitle, String? group, bool? disabled, bool? hidden, dynamic meta, S2ChoiceStyle? style, S2ChoiceStyle? activeStyle, ValueSetter<bool?>? select, bool? selected}) S2Choice<T>
Creates a copy of this S2Choice but with the given fields replaced with the new values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
merge(S2Choice<T>? other) S2Choice<T>
Creates a copy of this S2Choice but with the given fields replaced with the new values.
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
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

listFrom<R, E>({required List<E> source, required S2OptionProp<E, R> value, required S2OptionProp<E, String> title, S2OptionProp<E, String>? subtitle, S2OptionProp<E, String>? group, S2OptionProp<E, bool>? disabled, S2OptionProp<E, bool>? hidden, S2OptionProp<E, dynamic>? meta, S2OptionProp<E, S2ChoiceStyle>? style, S2OptionProp<E, S2ChoiceStyle>? activeStyle}) List<S2Choice<R>>
Helper to create option list from any list