pub struct ChoiceChip {Show 32 fields
pub key: Option<KeyRef>,
pub avatar: Option<WidgetRef>,
pub label: WidgetRef,
pub label_style: Option<TextStyle>,
pub label_padding: Option<EdgeInsetsGeometry>,
pub on_selected: Option<ValueChanged<bool>>,
pub press_elevation: Option<f64>,
pub selected: bool,
pub selected_color: Option<Color>,
pub disabled_color: Option<Color>,
pub tooltip: Option<String>,
pub side: Option<AnyBorderSide>,
pub shape: Option<OutlinedBorderRef>,
pub clip_behavior: Clip,
pub focus_node: Option<FocusNodeRef>,
pub autofocus: bool,
pub color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub background_color: Option<Color>,
pub padding: Option<EdgeInsetsGeometry>,
pub visual_density: Option<VisualDensity>,
pub material_tap_target_size: Option<MaterialTapTargetSize>,
pub elevation: Option<f64>,
pub shadow_color: Option<Color>,
pub surface_tint_color: Option<Color>,
pub icon_theme: Option<IconThemeData>,
pub selected_shadow_color: Option<Color>,
pub show_checkmark: Option<bool>,
pub checkmark_color: Option<Color>,
pub avatar_border: ShapeBorderRef,
pub avatar_box_constraints: Option<BoxConstraints>,
pub chip_animation_style: Option<ChipAnimationStyle>,
pub mouse_cursor: Option<MouseCursorRef>,
/* private fields */
}Expand description
A Material Design choice chip.
ChoiceChips represent a single choice from a set. Choice chips contain
related descriptive text or categories.
Requires one of its ancestors to be a Material widget.
§Material Design 3
ChoiceChip can be used for single select Filter chips from
Material Design 3. If ThemeData::use_material3 is true, then ChoiceChip
will be styled to match the Material Design 3 specification for Filter
chips. Use FilterChip for multiple select Filter chips.
See also:
Chip, a chip that displays information and can be deleted.InputChip, a chip that represents a complex piece of information, such as an entity (person, place, or thing) or conversational text, in a compact form.FilterChip, uses tags or descriptive words as a way to filter content.ActionChip, represents an action related to primary content.CircleAvatar, which shows images or initials of people.Wrap, A widget that displays its children in multiple horizontal or vertical runs.- https://material.io/design/components/chips.html
Fields§
§key: Option<KeyRef>§avatar: Option<WidgetRef>§label: WidgetRef§label_style: Option<TextStyle>§label_padding: Option<EdgeInsetsGeometry>§on_selected: Option<ValueChanged<bool>>§press_elevation: Option<f64>§selected: bool§selected_color: Option<Color>§disabled_color: Option<Color>§tooltip: Option<String>§side: Option<AnyBorderSide>§shape: Option<OutlinedBorderRef>§clip_behavior: Clip§focus_node: Option<FocusNodeRef>§autofocus: bool§color: Option<WidgetStatePropertyRef<Option<Color>>>§background_color: Option<Color>§padding: Option<EdgeInsetsGeometry>§visual_density: Option<VisualDensity>§material_tap_target_size: Option<MaterialTapTargetSize>§elevation: Option<f64>§shadow_color: Option<Color>§surface_tint_color: Option<Color>§icon_theme: Option<IconThemeData>§selected_shadow_color: Option<Color>§show_checkmark: Option<bool>§checkmark_color: Option<Color>§avatar_border: ShapeBorderRef§avatar_box_constraints: Option<BoxConstraints>§chip_animation_style: Option<ChipAnimationStyle>§mouse_cursor: Option<MouseCursorRef>Implementations§
Source§impl ChoiceChip
impl ChoiceChip
Sourcepub fn new<K>(label: impl IntoWidget<K>, selected: bool) -> ChoiceChip
pub fn new<K>(label: impl IntoWidget<K>, selected: bool) -> ChoiceChip
Create a chip.
The elevation and press_elevation must be null or non-negative. Dart’s named arguments are the setters.
Sourcepub fn elevated<K>(label: impl IntoWidget<K>, selected: bool) -> ChoiceChip
pub fn elevated<K>(label: impl IntoWidget<K>, selected: bool) -> ChoiceChip
Create an elevated chip.
The elevation and press_elevation must be null or non-negative. Dart’s named arguments are the setters.
Sourcepub fn key(self, key: KeyRef) -> ChoiceChip
pub fn key(self, key: KeyRef) -> ChoiceChip
Dart ChoiceChip(key:).
Sourcepub fn label_style(self, label_style: TextStyle) -> ChoiceChip
pub fn label_style(self, label_style: TextStyle) -> ChoiceChip
Dart ChoiceChip(label_style:).
Sourcepub fn on_selected(self, on_selected: ValueChanged<bool>) -> ChoiceChip
pub fn on_selected(self, on_selected: ValueChanged<bool>) -> ChoiceChip
Dart ChoiceChip(on_selected:).
Sourcepub fn selected_color(self, selected_color: Color) -> ChoiceChip
pub fn selected_color(self, selected_color: Color) -> ChoiceChip
Dart ChoiceChip(selected_color:).
Sourcepub fn disabled_color(self, disabled_color: Color) -> ChoiceChip
pub fn disabled_color(self, disabled_color: Color) -> ChoiceChip
Dart ChoiceChip(disabled_color:).
Sourcepub fn tooltip(self, tooltip: String) -> ChoiceChip
pub fn tooltip(self, tooltip: String) -> ChoiceChip
Dart ChoiceChip(tooltip:).
Sourcepub fn focus_node(self, focus_node: FocusNodeRef) -> ChoiceChip
pub fn focus_node(self, focus_node: FocusNodeRef) -> ChoiceChip
Dart ChoiceChip(focus_node:).
Sourcepub fn color(self, color: WidgetStatePropertyRef<Option<Color>>) -> ChoiceChip
pub fn color(self, color: WidgetStatePropertyRef<Option<Color>>) -> ChoiceChip
Dart ChoiceChip(color:).
Sourcepub fn background_color(self, background_color: Color) -> ChoiceChip
pub fn background_color(self, background_color: Color) -> ChoiceChip
Dart ChoiceChip(background_color:).
Sourcepub fn visual_density(self, visual_density: VisualDensity) -> ChoiceChip
pub fn visual_density(self, visual_density: VisualDensity) -> ChoiceChip
Dart ChoiceChip(visual_density:).
Sourcepub fn material_tap_target_size(
self,
material_tap_target_size: MaterialTapTargetSize,
) -> ChoiceChip
pub fn material_tap_target_size( self, material_tap_target_size: MaterialTapTargetSize, ) -> ChoiceChip
Dart ChoiceChip(material_tap_target_size:).
Sourcepub fn shadow_color(self, shadow_color: Color) -> ChoiceChip
pub fn shadow_color(self, shadow_color: Color) -> ChoiceChip
Dart ChoiceChip(shadow_color:).
Sourcepub fn surface_tint_color(self, surface_tint_color: Color) -> ChoiceChip
pub fn surface_tint_color(self, surface_tint_color: Color) -> ChoiceChip
Dart ChoiceChip(surface_tint_color:).
Sourcepub fn icon_theme(self, icon_theme: IconThemeData) -> ChoiceChip
pub fn icon_theme(self, icon_theme: IconThemeData) -> ChoiceChip
Dart ChoiceChip(icon_theme:).
Sourcepub fn selected_shadow_color(self, selected_shadow_color: Color) -> ChoiceChip
pub fn selected_shadow_color(self, selected_shadow_color: Color) -> ChoiceChip
Dart ChoiceChip(selected_shadow_color:).
Sourcepub fn show_checkmark(self, show_checkmark: bool) -> ChoiceChip
pub fn show_checkmark(self, show_checkmark: bool) -> ChoiceChip
Dart ChoiceChip(show_checkmark:).
Sourcepub fn checkmark_color(self, checkmark_color: Color) -> ChoiceChip
pub fn checkmark_color(self, checkmark_color: Color) -> ChoiceChip
Dart ChoiceChip(checkmark_color:).
Sourcepub fn avatar_box_constraints(
self,
avatar_box_constraints: BoxConstraints,
) -> ChoiceChip
pub fn avatar_box_constraints( self, avatar_box_constraints: BoxConstraints, ) -> ChoiceChip
Dart ChoiceChip(avatar_box_constraints:).
Sourcepub fn chip_animation_style(
self,
chip_animation_style: ChipAnimationStyle,
) -> ChoiceChip
pub fn chip_animation_style( self, chip_animation_style: ChipAnimationStyle, ) -> ChoiceChip
Dart ChoiceChip(chip_animation_style:).
Sourcepub fn mouse_cursor(self, mouse_cursor: MouseCursorRef) -> ChoiceChip
pub fn mouse_cursor(self, mouse_cursor: MouseCursorRef) -> ChoiceChip
Dart ChoiceChip(mouse_cursor:).
Sourcepub fn clip_behavior(self, clip_behavior: Clip) -> ChoiceChip
pub fn clip_behavior(self, clip_behavior: Clip) -> ChoiceChip
Dart ChoiceChip(clip_behavior:).
Sourcepub fn autofocus(self, autofocus: bool) -> ChoiceChip
pub fn autofocus(self, autofocus: bool) -> ChoiceChip
Dart ChoiceChip(autofocus:).
Sourcepub fn avatar_border(self, avatar_border: ShapeBorderRef) -> ChoiceChip
pub fn avatar_border(self, avatar_border: ShapeBorderRef) -> ChoiceChip
Dart ChoiceChip(avatar_border:).
Sourcepub fn avatar<K>(self, avatar: impl IntoWidget<K>) -> ChoiceChip
pub fn avatar<K>(self, avatar: impl IntoWidget<K>) -> ChoiceChip
Dart ChoiceChip(avatar:).
Sourcepub fn label_padding(
self,
label_padding: impl Into<EdgeInsetsGeometry>,
) -> ChoiceChip
pub fn label_padding( self, label_padding: impl Into<EdgeInsetsGeometry>, ) -> ChoiceChip
Dart ChoiceChip(label_padding:).
Sourcepub fn side(self, side: impl Into<AnyBorderSide>) -> ChoiceChip
pub fn side(self, side: impl Into<AnyBorderSide>) -> ChoiceChip
Dart ChoiceChip(side:).
Sourcepub fn shape(self, shape: impl Into<OutlinedBorderRef>) -> ChoiceChip
pub fn shape(self, shape: impl Into<OutlinedBorderRef>) -> ChoiceChip
Dart ChoiceChip(shape:).
Sourcepub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> ChoiceChip
pub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> ChoiceChip
Dart ChoiceChip(padding:).
Sourcepub fn press_elevation(self, press_elevation: f64) -> ChoiceChip
pub fn press_elevation(self, press_elevation: f64) -> ChoiceChip
Dart ChoiceChip(press_elevation:).
Sourcepub fn elevation(self, elevation: f64) -> ChoiceChip
pub fn elevation(self, elevation: f64) -> ChoiceChip
Dart ChoiceChip(elevation:).
Trait Implementations§
Source§impl CheckmarkableChipAttributes for ChoiceChip
impl CheckmarkableChipAttributes for ChoiceChip
Source§fn show_checkmark(&self) -> Option<bool>
fn show_checkmark(&self) -> Option<bool>
SelectableChipAttributes::selected is true. Read moreSource§impl ChipAttributes for ChoiceChip
impl ChipAttributes for ChoiceChip
Source§fn avatar(&self) -> Option<&WidgetRef>
fn avatar(&self) -> Option<&WidgetRef>
Source§fn label_style(&self) -> Option<&TextStyle>
fn label_style(&self) -> Option<&TextStyle>
Source§fn side(&self) -> Option<&AnyBorderSide>
fn side(&self) -> Option<&AnyBorderSide>
Source§fn shape(&self) -> Option<&OutlinedBorderRef>
fn shape(&self) -> Option<&OutlinedBorderRef>
OutlinedBorder to draw around the chip. Read moreSource§fn clip_behavior(&self) -> Clip
fn clip_behavior(&self) -> Clip
Clip::None.Source§fn focus_node(&self) -> Option<&FocusNodeRef>
fn focus_node(&self) -> Option<&FocusNodeRef>
InkWell.Source§fn color(&self) -> Option<&WidgetStatePropertyRef<Option<Color>>>
fn color(&self) -> Option<&WidgetStatePropertyRef<Option<Color>>>
WidgetStates. Read moreSource§fn background_color(&self) -> Option<Color>
fn background_color(&self) -> Option<Color>
Source§fn padding(&self) -> Option<&EdgeInsetsGeometry>
fn padding(&self) -> Option<&EdgeInsetsGeometry>
Source§fn visual_density(&self) -> Option<VisualDensity>
fn visual_density(&self) -> Option<VisualDensity>
Source§fn label_padding(&self) -> Option<&EdgeInsetsGeometry>
fn label_padding(&self) -> Option<&EdgeInsetsGeometry>
Source§fn material_tap_target_size(&self) -> Option<MaterialTapTargetSize>
fn material_tap_target_size(&self) -> Option<MaterialTapTargetSize>
Source§fn elevation(&self) -> Option<f64>
fn elevation(&self) -> Option<f64>
Source§fn shadow_color(&self) -> Option<Color>
fn shadow_color(&self) -> Option<Color>
Source§fn surface_tint_color(&self) -> Option<Color>
fn surface_tint_color(&self) -> Option<Color>
Source§fn icon_theme(&self) -> Option<&IconThemeData>
fn icon_theme(&self) -> Option<&IconThemeData>
Source§fn avatar_box_constraints(&self) -> Option<BoxConstraints>
fn avatar_box_constraints(&self) -> Option<BoxConstraints>
Source§fn chip_animation_style(&self) -> Option<&ChipAnimationStyle>
fn chip_animation_style(&self) -> Option<&ChipAnimationStyle>
Source§fn mouse_cursor(&self) -> Option<&MouseCursorRef>
fn mouse_cursor(&self) -> Option<&MouseCursorRef>
Source§impl Clone for ChoiceChip
impl Clone for ChoiceChip
Source§impl Debug for ChoiceChip
impl Debug for ChoiceChip
Source§impl DisabledChipAttributes for ChoiceChip
impl DisabledChipAttributes for ChoiceChip
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Source§fn disabled_color(&self) -> Option<Color>
fn disabled_color(&self) -> Option<Color>
Source§impl SelectableChipAttributes for ChoiceChip
impl SelectableChipAttributes for ChoiceChip
Source§fn on_selected(&self) -> Option<&ValueChanged<bool>>
fn on_selected(&self) -> Option<&ValueChanged<bool>>
Source§fn press_elevation(&self) -> Option<f64>
fn press_elevation(&self) -> Option<f64>
Source§fn selected_color(&self) -> Option<Color>
fn selected_color(&self) -> Option<Color>
Source§fn selected_shadow_color(&self) -> Option<Color>
fn selected_shadow_color(&self) -> Option<Color>
Source§fn tooltip(&self) -> Option<&str>
fn tooltip(&self) -> Option<&str>
Source§fn avatar_border(&self) -> &ShapeBorderRef
fn avatar_border(&self) -> &ShapeBorderRef
Source§impl StatelessWidget for ChoiceChip
impl StatelessWidget for ChoiceChip
Source§fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn debug_check_constructor(&self)
fn debug_check_constructor(&self)
Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
impl !RefUnwindSafe for ChoiceChip
impl !Send for ChoiceChip
impl !Sync for ChoiceChip
impl !UnwindSafe for ChoiceChip
impl Forget for ChoiceChip
impl Freeze for ChoiceChipwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const RcInner<Paint> is !null: Freeze,
PhantomData<RcInner<Paint>>: Freeze,
PhantomData<Shadow>: Freeze,
PhantomData<FontFeature>: Freeze,
PhantomData<FontVariation>: Freeze,
*const RcInner<dyn Fn(&mut App, bool)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, bool)>>: Freeze,
*const RcInner<dyn BorderSideExtension> is !null: Freeze,
PhantomData<RcInner<dyn BorderSideExtension>>: Freeze,
*const RcInner<dyn OutlinedBorder> is !null: Freeze,
PhantomData<RcInner<dyn OutlinedBorder>>: Freeze,
NonZero<u32>: Freeze,
&'static FocusNodeVTable: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: Freeze,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: Freeze,
*const RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>>: Freeze,
*const RcInner<dyn ShapeBorder> is !null: Freeze,
PhantomData<RcInner<dyn ShapeBorder>>: Freeze,
*const RcInner<dyn Curve> is !null: Freeze,
PhantomData<RcInner<dyn Curve>>: Freeze,
*const RcInner<dyn MouseCursor> is !null: Freeze,
PhantomData<RcInner<dyn MouseCursor>>: Freeze,
impl Move for ChoiceChip
impl Unpin for ChoiceChipwhere
Rc<dyn Key>: Unpin,
Rc<dyn Widget>: Unpin,
&'static dyn ColorExtension: Unpin,
Rc<dyn ColorExtension>: Unpin,
*const u8 is !null: Unpin,
Rc<Paint>: Unpin,
Rc<dyn Fn(&mut App, bool)>: Unpin,
Rc<dyn BorderSideExtension>: Unpin,
Rc<dyn OutlinedBorder>: Unpin,
NonZero<u32>: Unpin,
&'static FocusNodeVTable: Unpin,
Rc<Keep>: Unpin,
Rc<dyn WidgetStateProperty<Option<Color>>>: Unpin,
Rc<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>: Unpin,
Rc<dyn ShapeBorder>: Unpin,
Rc<dyn Curve>: Unpin,
Rc<dyn MouseCursor>: Unpin,
impl UnsafeUnpin for ChoiceChipwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const RcInner<Paint> is !null: UnsafeUnpin,
PhantomData<RcInner<Paint>>: UnsafeUnpin,
PhantomData<Shadow>: UnsafeUnpin,
PhantomData<FontFeature>: UnsafeUnpin,
PhantomData<FontVariation>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, bool)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, bool)>>: UnsafeUnpin,
*const RcInner<dyn BorderSideExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn BorderSideExtension>>: UnsafeUnpin,
*const RcInner<dyn OutlinedBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn OutlinedBorder>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static FocusNodeVTable: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: UnsafeUnpin,
*const RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&IconThemeData, &mut App, AnyElement) -> IconThemeData>>: UnsafeUnpin,
*const RcInner<dyn ShapeBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ShapeBorder>>: UnsafeUnpin,
*const RcInner<dyn Curve> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Curve>>: UnsafeUnpin,
*const RcInner<dyn MouseCursor> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn MouseCursor>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.