Skip to Content

Chip

A compact, pill-shaped label used to represent an attribute, filter, or selection. When OnDeleted is provided a dismiss button is shown on the trailing edge; tapping it invokes the callback so the caller can remove the chip from the tree. Colors default to a tinted surface derived from the active theme’s primary color.

Constructor

Chip

Creates a Chip element.

ParameterDescription
labelThe text to display. Must not be null.
onDeletedCallback invoked when the dismiss button is tapped. Null suppresses the dismiss button entirely.
colorThe chip background color. Null uses a primary-tinted surface from the theme.
keyAn optional key for reconciliation identity.

Properties

Color

Background color of the chip surface. Null defaults to a tinted surface derived from the theme’s primary color.

Label

The text label displayed inside the chip.

OnDeleted

Callback invoked when the user taps the dismiss button. Null means no dismiss button is rendered.

Methods

CreateState

Last updated on