NovaChipGroup class

A group of NovaChip widgets with single or multi select support.

Example:

// Single select
NovaChipGroup(
  chips: ['Flutter', 'React', 'Vue'],
  selectedIndex: _selected,
  onChanged: (i) => setState(() => _selected = i),
)

// Multi select
NovaChipGroup.multi(
  chips: ['Design', 'Code', 'Testing'],
  selectedIndexes: _selected,
  onChanged: (indexes) => setState(() => _selected = indexes),
)
Inheritance

Constructors

NovaChipGroup({Key? key, required List<String> chips, required void onChanged(int)?, int selectedIndex = 0, NovaChipColor color = NovaChipColor.primary, double spacing = 8, double runSpacing = 8})
Single select chip group.
const
NovaChipGroup.multi({Key? key, required List<String> chips, required List<int> selectedIndexes, required void onMultiChanged(List<int>), NovaChipColor color = NovaChipColor.primary, double spacing = 8, double runSpacing = 8})
Multi select chip group.
const

Properties

chips List<String>
List of chip labels.
final
color NovaChipColor
Color applied to all chips.
final
hashCode int
The hash code for this object.
no setterinherited
isMulti bool
Whether this is a multi select group.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged → void Function(int)?
Called when selection changes in single select mode.
final
onMultiChanged → void Function(List<int>)?
Called when selection changes in multi select mode.
final
runSpacing double
Vertical spacing between chip rows.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedIndex int
Selected index for single select mode.
final
selectedIndexes List<int>
Selected indexes for multi select mode.
final
spacing double
Horizontal spacing between chips.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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, int wrapWidth = 65}) 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