OudsFilterChip class
Reference design version : 1.5.0
Filter chip is a UI element that allows to select or deselect an option within a series, and is commonly used to capture filtering decisions. Filter chip allows to filter content by being selected or deselected. It can be toggled "On" or "Off" to refine displayed results, and selected Filter 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: Text label displayed in the chip.
- icon: Icon displayed in the chip. Use an icon to add additional affordance where the icon has a clear and well-established meaning.
- selected: Whether this chip is selected or not. If this value is null so the component is in disabled state.
- onSelected : Called when this chip is clicked. A null value indicates that the component is disabled.
You can use OudsFilterChip component in your project, customizing parameters as needed :
Text only filter chip : This is the default layout of the component.
OudsFilterChip(
label: 'Label',
selected: true,
onSelected: () {},
);
Text with icon filter chip :
OudsFilterChip.icon(
label: 'Label',
icon: OudsIcon('assets/ic_chip_heart.svg'),
selected: true,
onSelected: (bool selected) {},
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OudsFilterChip
Constructors
-
OudsFilterChip({Key? key, String? label, @Deprecated("This parameter is deprecated and will be removed in a future version. Use icon instead in OudsFilterChip.icon constructor .") String? avatar, bool selected = false, ValueChanged<
bool> ? onSelected}) -
Creates a text-only OudsFilterChip.
const
-
OudsFilterChip.icon({Key? key, String? label, OudsIcon? icon, bool selected = false, ValueChanged<
bool> ? onSelected, String? contentDescription}) -
Creates an OudsFilterChip with a text and an icon.
const
Properties
- avatar → String?
-
final
- contentDescription → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → OudsIcon?
-
final
- 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