ChipList class Null safety

Creates a list of ChoiceChips with all logic handled.

Set the names of chips and boom ! Use supportsMultiSelect if multiple chips can be selected at once.

Inheritance

Constructors

ChipList({Key? key, required List<String> listOfChipNames, required List<int> listOfChipIndicesCurrentlySeclected, List<Color> activeTextColorList = const [Colors.white], List<Color> inactiveTextColorList = const [Colors.blue], List<Color> activeBgColorList = const [Colors.blue], List<Color> inactiveBgColorList = const [Colors.white], TextStyle? style, List<Color> inactiveBorderColorList = const [Colors.white], List<Color> activeBorderColorList = const [Colors.white], List<double> borderRadiiList = const [15], bool supportsMultiSelect = false, OnToggle? extraOnToggle, bool shouldWrap = false, ScrollPhysics? scrollPhysics, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center, WrapAlignment wrapAlignment = WrapAlignment.start, WrapCrossAlignment wrapCrossAlignment = WrapCrossAlignment.start, Axis axis = Axis.horizontal, WrapAlignment runAlignment = WrapAlignment.start, double runSpacing = 0.0, double spacing = 0.0, TextDirection? textDirection, VerticalDirection verticalDirection = VerticalDirection.down})
const

Properties

activeBgColorList List<Color>
The background color of an active ChoiceChip.
final
activeBorderColorList List<Color>
If you want to customize the border color of each active ChoiceChip, then set the color of each here, in order.
final
activeTextColorList List<Color>
The text color of an active ChoiceChip.
final
axis Axis
Axis used, if shouldWrap is true.
final
borderRadiiList List<double>
If you want to customize the border radii of each ChoiceChip, then set the radius of each ChoiceChip here in order.
final
extraOnToggle OnToggle?
In case you chain some more logic to this widget's onTap event (maybe trigger updation of other UI components). If this is used, ensure you call setState at the end of the function.
final
hashCode int
The hash code for this object.
@nonVirtualread-onlyinherited
inactiveBgColorList List<Color>
The background color of an inactive ChoiceChip.
final
inactiveBorderColorList List<Color>
If you want to customize the border color of each inactive ChoiceChip, then set the color of each here, in order.
final
inactiveTextColorList List<Color>
The text color of an inactive ChoiceChip.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listOfChipIndicesCurrentlySeclected List<int>
Initial index that must be selected. Useful to sync this widget with others if need be.
final
listOfChipNames List<String>
List of ChoiceChip names in order of building them.
final
mainAxisAlignment MainAxisAlignment
MainAxisAlignment for the parent Row or Column of the ChipList, which is used in case of Axis.horizontal or Axis.vertical being passed in to axis.
final
runAlignment WrapAlignment
WrapAlignment used, if shouldWrap is true.
final
runSpacing double
runSpacing used, if shouldWrap is true,
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
scrollPhysics ScrollPhysics?
If you wish to change the ScrollPhysics of the widget.
final
shouldWrap bool
Determines if the chip_list should be wrapped.
final
spacing double
spacing used, if shouldWrap is true,
final
style TextStyle?
For any text styling needs.
final
supportsMultiSelect bool
If multiple ChoiceChips can be selected at once.
final
textDirection TextDirection?
textDirection used, if shouldWrap is true,
final
verticalDirection VerticalDirection
verticalDirection used, if shouldWrap is true,
final
widgetSpacing double
Use this to alter the padding of widgets in the list of the list,
final
wrapAlignment WrapAlignment
WrapAlignment used, if shouldWrap is true.
final
wrapCrossAlignment WrapCrossAlignment
WrapCrossAlignment used, if shouldWrap is true
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _ChipListState
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.
@protectedinherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.
@nonVirtualinherited