ChipSelection<T> class

Easy way to provide a single or multiple choice chips.

Inheritance

Constructors

ChipSelection.multiple({Key? key, required List<T> value, required ChipSelectionChanged<List<T>> onChanged, required List<ChipSelectionData<T>> choiceItems, ChipSelectionLoader<T>? choiceLoader, ChipSelectionItemStyle? choiceStyle, ChipSelectionItemStyle? choiceActiveStyle, ChipSelectionBuilder<T>? choiceLabelBuilder, ChipSelectionBuilder<T>? choiceAvatarBuilder, ChipSelectionBuilder<T>? choiceBuilder, WidgetBuilder? spinnerBuilder, WidgetBuilder? placeholderBuilder, WidgetBuilder? errorBuilder, bool wrapped = false, EdgeInsetsGeometry? padding, Axis direction = Axis.horizontal, VerticalDirection verticalDirection = VerticalDirection.down, TextDirection? textDirection, Clip clipBehavior = Clip.hardEdge, ScrollPhysics? scrollPhysics, MainAxisSize mainAxisSize = MainAxisSize.max, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, WrapAlignment alignment = WrapAlignment.start, WrapAlignment runAlignment = WrapAlignment.start, WrapCrossAlignment wrapCrossAlignment = WrapCrossAlignment.start, double spacing = 10.0, double runSpacing = 0, String? placeholder, TextStyle? placeholderStyle, TextAlign? placeholderAlign, TextStyle? errorStyle, TextAlign? errorAlign, double? spinnerSize, Color? spinnerColor, double? spinnerThickness})
Constructor for multiple choice
ChipSelection.single({Key? key, required T value, required ChipSelectionChanged<T> onChanged, required List<ChipSelectionData<T>> choiceItems, ChipSelectionLoader<T>? choiceLoader, ChipSelectionItemStyle? choiceStyle, ChipSelectionItemStyle? choiceActiveStyle, ChipSelectionBuilder<T>? choiceLabelBuilder, ChipSelectionBuilder<T>? choiceAvatarBuilder, ChipSelectionBuilder<T>? choiceBuilder, WidgetBuilder? spinnerBuilder, WidgetBuilder? placeholderBuilder, WidgetBuilder? errorBuilder, bool wrapped = false, EdgeInsetsGeometry? padding, Axis direction = Axis.horizontal, VerticalDirection verticalDirection = VerticalDirection.down, TextDirection? textDirection, Clip clipBehavior = Clip.hardEdge, ScrollPhysics? scrollPhysics, MainAxisSize mainAxisSize = MainAxisSize.max, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, WrapAlignment alignment = WrapAlignment.start, WrapAlignment runAlignment = WrapAlignment.start, WrapCrossAlignment wrapCrossAlignment = WrapCrossAlignment.start, double spacing = 10.0, double runSpacing = 0, String? placeholder, TextStyle? placeholderStyle, TextAlign? placeholderAlign, TextStyle? errorStyle, TextAlign? errorAlign, double? spinnerSize, Color? spinnerColor, double? spinnerThickness})
Costructor for single choice

Properties

alignment WrapAlignment
if wrapped is true, determines how wrap will align the objects
final
choiceActiveStyle ChipSelectionItemStyle?
Choice selected item style
final
choiceAvatarBuilder ChipSelectionBuilder<T>?
Builder for custom choice item label
final
choiceBuilder ChipSelectionBuilder<T>?
Builder for custom choice item
final
choiceItems List<ChipSelectionData<T>>
List of choice item
final
choiceLabelBuilder ChipSelectionBuilder<T>?
Builder for custom choice item label
final
choiceLoader ChipSelectionLoader<T>?
Async loader of choice items
final
choiceStyle ChipSelectionItemStyle?
Choice unselected item style
final
clipBehavior Clip
Clip behavior
final
crossAxisAlignment CrossAxisAlignment
if wrapped is false, How the children should be placed along the cross axis.
final
direction Axis
The direction to use as the main axis.
final
errorAlign TextAlign?
error text align
final
errorBuilder WidgetBuilder?
Builder for placeholder widget
final
errorStyle TextStyle?
error text style
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainAxisAlignment MainAxisAlignment
if wrapped is false, How the children should be placed along the main axis.
final
mainAxisSize MainAxisSize
if wrapped is false, How much space should be occupied in the main axis.
final
padding EdgeInsetsGeometry?
Container padding
final
placeholder String?
String to display when choice items is empty
final
placeholderAlign TextAlign?
placeholder text align
final
placeholderBuilder WidgetBuilder?
Builder for placeholder widget
final
placeholderStyle TextStyle?
placeholder text style
final
runAlignment WrapAlignment
if wrapped is true, how the runs themselves should be placed in the cross axis.
final
runSpacing double
if wrapped is true, how much space to place between the runs themselves in the cross axis.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollPhysics ScrollPhysics?
if wrapped is false, How the scroll view should respond to user input.
final
spacing double
if wrapped is true, how much space to place between children in a run in the main axis.
final
spinnerBuilder WidgetBuilder?
Builder for spinner widget
final
spinnerColor Color?
spinner color
final
spinnerSize double?
spinner size
final
spinnerThickness double?
spinner thickness
final
textDirection TextDirection?
Determines the order to lay children out horizontally and how to interpret start and end in the horizontal direction.
final
verticalDirection VerticalDirection
Determines the order to lay children out vertically and how to interpret start and end in the vertical direction.
final
wrapCrossAlignment WrapCrossAlignment
if wrapped is true, how the children within a run should be aligned relative to each other in the cross axis.
final
wrapped bool
Whether the chips is wrapped or scrollable
final

Methods

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

Static Properties

defaultPadding EdgeInsetsGeometry
default padding for spinner and placeholder
final
defaultPlaceholder String
default placeholder string
final
defaultScrollableChipMargin EdgeInsetsGeometry
default chip margin in scrollable list
final
defaultScrollablePadding EdgeInsetsGeometry
default padding for scrollable list
final
defaultWrappedChipMargin EdgeInsetsGeometry
default chip margin in wrapped list
final
defaultWrappedPadding EdgeInsetsGeometry
default padding for wrapped list
final