C2Choice<T> class

Choice item

Constructors

C2Choice({required T value, required String label, ImageProvider<Object>? avatarImage, Widget? avatarText, String? tooltip, dynamic meta, C2ChipStyle? style, VoidCallback? delete, dynamic select(bool selected)?, bool selected = false, bool disabled = false, bool hidden = false})
Default Constructor
const

Properties

avatarImage ImageProvider<Object>?
Typically used as profile image.
final
avatarText Widget?
The primary content of the chip avatar.
final
delete VoidCallback?
Called when the user taps the deleteIcon to delete the chip.
final
disabled bool
Whether the choice is disabled or not
final
hashCode int
The hash code for this object.
no setteroverride
hidden bool
Whether the choice is hidden or displayed
final
label String
Represent as primary text
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 → (dynamic Function(bool selected)?)
Callback to select choice autofill by the system used in choice builder
final
selected bool
Whether the choice is selected or not autofill by the system used in choice builder
final
style C2ChipStyle?
Individual choice unselected item style
final
tooltip String?
Tooltip string to be used for the body area (where the label and avatar are) of the chip.
final
value → T
Value to return
final

Methods

copyWith({T? value, String? label, ImageProvider<Object>? avatarImage, Widget? avatarText, String? tooltip, bool? disabled, bool? hidden, dynamic meta, C2ChipStyle? style, VoidCallback? delete, dynamic select(bool selected)?, bool? selected}) C2Choice<T>
Creates a copy of this C2Choice but with the given fields replaced with the new values.
merge(C2Choice<T>? other) C2Choice<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
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

listFrom<R, E>({required List<E> source, required R value(int index, E item), required String label(int index, E item), _C2ChoiceProp<E, ImageProvider<Object>>? avatarImage, _C2ChoiceProp<E, Widget>? avatarText, _C2ChoiceProp<E, String>? tooltip, _C2ChoiceProp<E, bool>? disabled, _C2ChoiceProp<E, bool>? hidden, _C2ChoiceProp<E, dynamic>? meta, _C2ChoiceProp<E, C2ChipStyle>? style, _C2ChoiceProp<E, VoidCallback>? delete}) List<C2Choice<R>>
Helper to create choice items from any list