ChipList class

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, EdgeInsets padding = EdgeInsets.zero, double widgetSpacing = 4, Color? checkmarkColor, bool showCheckmark = true})

Properties

activeBgColorList List<Color>
The background color of an active ChoiceChip.
getter/setter pair
activeBorderColorList List<Color>
If you want to customize the border color of each active ChoiceChip, then set the color of each here, in order.
getter/setter pair
activeTextColorList List<Color>
The text color of an active ChoiceChip.
getter/setter pair
axis Axis
Axis used, if shouldWrap is true.
getter/setter pair
borderRadiiList List<double>
If you want to customize the border radii of each ChoiceChip, then set the radius of each ChoiceChip here in order.
getter/setter pair
checkmarkColor Color?
Sets color for checkmark if enabled Defaults to null, which triggers Flutter to use the appropriate color based off of the Brightness setting. If you're not sure, leave this blank
getter/setter pair
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.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
inactiveBgColorList List<Color>
The background color of an inactive ChoiceChip.
getter/setter pair
inactiveBorderColorList List<Color>
If you want to customize the border color of each inactive ChoiceChip, then set the color of each here, in order.
getter/setter pair
inactiveTextColorList List<Color>
The text color of an inactive ChoiceChip.
getter/setter pair
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.
getter/setter pair
listOfChipNames List<String>
List of ChoiceChip names in order of building them.
getter/setter pair
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.
getter/setter pair
padding EdgeInsets
Sets the inner spacing for the child of each ChoiceChip. Defaults to EdgeInsets.zero.
getter/setter pair
runAlignment WrapAlignment
WrapAlignment used, if shouldWrap is true.
getter/setter pair
runSpacing double
runSpacing used, if shouldWrap is true,
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollPhysics ScrollPhysics?
If you wish to change the ScrollPhysics of the widget.
getter/setter pair
shouldWrap bool
Determines if the chip_list should be wrapped.
getter/setter pair
showCheckmark bool
Sets if the checkMark is enabled Defaults to true
getter/setter pair
spacing double
spacing used, if shouldWrap is true,
getter/setter pair
style TextStyle?
For any text styling needs.
getter/setter pair
supportsMultiSelect bool
If multiple ChoiceChips can be selected at once.
getter/setter pair
textDirection TextDirection?
textDirection used, if shouldWrap is true,
getter/setter pair
verticalDirection VerticalDirection
verticalDirection used, if shouldWrap is true,
getter/setter pair
widgetSpacing double
Use this to alter the padding of widgets in the list of the list,
getter/setter pair
wrapAlignment WrapAlignment
WrapAlignment used, if shouldWrap is true.
getter/setter pair
wrapCrossAlignment WrapCrossAlignment
WrapCrossAlignment used, if shouldWrap is true
getter/setter pair

Methods

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