OudsFilterChip class
A filter chip is a compact UI element used in a design system to represent a filter option that can be selected or deselected by the user. Filter chips allow users to refine content or data by applying one or more filters in a visually accessible and interactive way. Purpose: Allows users to filter content by selecting or deselecting specific categories or attributes. Behavior: Can be toggled on/off to refine displayed results. Selected chips remain visually distinct to indicate active filters.
This version of the filter chip uses the text only layout which is the most used layout. Other layouts are available for this component: text + icon and icon only.
Parameters:
- label: Label displayed in the suggestion chip which describes the chip option.
- avatar: Icon displayed in the suggestion chip. Works well with universally recognized symbols, such as a heart for favorites or a checkmark for selection.
You can use OudsFilterChip like this :
Text only chip :
This is the default layout of the component.
OudsFilterChip(
label: 'Label',
selected: true,
onSelected: () {},
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OudsFilterChip
Constructors
-
OudsFilterChip.new({Key? key, String? label, String? avatar, bool? selected, ValueChanged<
bool> ? onSelected}) -
const
Properties
- avatar → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String?
-
final
- layout → OudsChipLayout
-
Property that detects and returns the chip layout based on the provided elements (text and/or icon)
no setter
-
onSelected
→ ValueChanged<
bool> ? -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected → bool?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< OudsFilterChip> -
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, 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
Static Methods
-
buildIcon(
BuildContext context, String assetName, OudsChipControlState controlItemState) → Widget