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
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ChipList
Constructors
-
ChipList({Key? key, required List<
String> listOfChipNames, required Color activeBgColor, required Color inactiveBgColor, required Color activeTextColor, required Color inactiveTextColor, required List<int> listOfChipIndicesCurrentlySeclected, TextStyle? style, List<Color> borderColorList = 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
- activeBgColor → Color
-
The background color of an active ChoiceChip
final
- activeTextColor → Color
-
The text color of an active ChoiceChip
final
- axis → Axis
-
Axis used, if shouldWrap is
true
final -
borderColorList
→ List<
Color> -
border color of each ChoiceChip, then set
the color of each ChoiceChip here in order.
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.
no setterinherited
- inactiveBgColor → Color
-
The background color of an inactive ChoiceChip
final
- inactiveTextColor → 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 of
the ChipList.
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.
no setterinherited
- scrollPhysics → ScrollPhysics?
-
If you wish to change the ScrollPhysics
of the widget.
final
- shouldWrap → bool
-
Determines if the chip_list should be wrapped.
If you set it to
true
, ensure that you wrap the ChipList within a SizedBox and define thewidth
property.final - spacing → double
-
spacing used, if shouldWrap is
true
,final - style → TextStyle?
-
For any styling needs.
Using
color
here is pointless as it will be overwritten by activeTextColor and inactiveTextColor.final - supportsMultiSelect → bool
-
If multiple
ChoiceChips
can be selected at once. Defaults tofalse
.final - textDirection → TextDirection?
-
textDirection used, if shouldWrap is
true
,final - verticalDirection → VerticalDirection
-
verticalDirection used, if shouldWrap is
true
,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.
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