pub struct ChipThemeData {Show 23 fields
pub color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub background_color: Option<Color>,
pub delete_icon_color: Option<AnyColor>,
pub disabled_color: Option<Color>,
pub selected_color: Option<Color>,
pub secondary_selected_color: Option<Color>,
pub shadow_color: Option<Color>,
pub surface_tint_color: Option<Color>,
pub selected_shadow_color: Option<Color>,
pub show_checkmark: Option<bool>,
pub checkmark_color: Option<Color>,
pub label_padding: Option<EdgeInsetsGeometry>,
pub padding: Option<EdgeInsetsGeometry>,
pub side: Option<AnyBorderSide>,
pub shape: Option<OutlinedBorderRef>,
pub label_style: Option<TextStyle>,
pub secondary_label_style: Option<TextStyle>,
pub brightness: Option<Brightness>,
pub elevation: Option<f64>,
pub press_elevation: Option<f64>,
pub icon_theme: Option<IconThemeData>,
pub avatar_box_constraints: Option<BoxConstraints>,
pub delete_icon_box_constraints: Option<BoxConstraints>,
}Expand description
Holds the color, shape, and text styles for a Material widget subtree.
ChipThemeData is used by ChipTheme to control the visual properties of chip
widgets in a widget hierarchy.
To obtain the current ChipThemeData for a given BuildContext, use
ChipTheme::of. A widget’s build method can use ChipTheme::of to obtain the
current visual properties for a chip.
The ChipTheme constructor is used to apply a ChipThemeData to a subtree, and
ThemeData::chip_theme is the default that applies when there is no ChipTheme.
See also:
ChipTheme, a widget that sets the theme data for a subtree.ThemeData, which describes the overall theme information for the application.
Fields§
§color: Option<WidgetStatePropertyRef<Option<Color>>>Overrides the default for ChipAttributes::color.
background_color: Option<Color>Color to be used for the unselected, enabled chip’s background.
The default is light grey.
delete_icon_color: Option<AnyColor>The Color for the delete icon. The default is Color(0xde000000) (slightly
transparent black) for light themes, and Color(0xdeffffff) (slightly transparent
white) for dark themes.
May be set to null, in which case the ambient IconTheme.color is used.
disabled_color: Option<Color>Color to be used for the chip’s background, indicating that it is disabled.
The chip is disabled when DisabledChipAttributes::is_enabled is false, or all three
of SelectableChipAttributes::on_selected, TappableChipAttributes::on_pressed, and
DeletableChipAttributes::on_deleted are null.
selected_color: Option<Color>Color to be used for the chip’s background, indicating that it is selected.
The chip is selected when SelectableChipAttributes::selected is true.
secondary_selected_color: Option<Color>An alternate color to be used for the chip’s background, indicating that it is
selected. For example, this color can be used for a ChoiceChip when selected.
shadow_color: Option<Color>Color of the chip’s shadow when the elevation is greater than 0.
surface_tint_color: Option<Color>Color of the chip’s surface tint overlay when its elevation is greater than 0.
This is not recommended for use. Material 3 spec introduced a set of tone-based
surfaces and surface containers in its ColorScheme, which provide more flexibility.
The intention is to eventually remove surface tint color from the framework.
selected_shadow_color: Option<Color>Color of the chip’s shadow when the elevation is greater than 0 and the chip is selected.
show_checkmark: Option<bool>Whether or not to show a check mark when
SelectableChipAttributes::selected is true.
checkmark_color: Option<Color>Color of the chip’s check mark when a check mark is visible.
This will override the color set by the platform’s brightness setting.
label_padding: Option<EdgeInsetsGeometry>The padding around the label widget.
By default, this is 4 logical pixels at the beginning and the end of the label, and zero on top and bottom.
padding: Option<EdgeInsetsGeometry>The padding between the contents of the chip and the outside
shape.
Defaults to 4 logical pixels on all sides.
side: Option<AnyBorderSide>The color and weight of the chip’s outline.
This value is combined with shape to create a shape decorated with
an outline. To omit the outline entirely, pass BorderSide::NONE to
side.
shape: Option<OutlinedBorderRef>The border to draw around the chip.
This shape is combined with side to create a shape decorated with an
outline.
label_style: Option<TextStyle>The style to be applied to the chip’s label.
This only has an effect on label widgets that respect the DefaultTextStyle, such as
Text.
secondary_label_style: Option<TextStyle>An alternate style to be applied to the chip’s label, indicating that it is selected.
This only has an effect on label widgets that respect the DefaultTextStyle, such as
Text.
brightness: Option<Brightness>Overrides the default for the brightness of the chip.
elevation: Option<f64>The elevation to be applied to the chip. Defaults to 0.
press_elevation: Option<f64>The elevation to be applied to the chip during the press motion. Defaults to 8.
icon_theme: Option<IconThemeData>Theme used for all icons in the chip.
avatar_box_constraints: Option<BoxConstraints>Optional size constraints for the avatar.
When unspecified, defaults to a minimum size of chip height or label height (whichever is greater) and a padding of 8.0 pixels on all sides.
delete_icon_box_constraints: Option<BoxConstraints>Optional size constraints for the delete icon.
When unspecified, defaults to a minimum size of chip height or label height (whichever is greater) and a padding of 8.0 pixels on all sides.
Implementations§
Source§impl ChipThemeData
impl ChipThemeData
Sourcepub fn new() -> ChipThemeData
pub fn new() -> ChipThemeData
Create a ChipThemeData given a set of exact values. Dart’s optional named
arguments are the fluent setters.
This will rarely be used directly. It is used by lerp to create
intermediate themes based on two themes.
Sourcepub fn from_defaults(
brightness: Option<Brightness>,
primary_color: Option<Color>,
secondary_color: Color,
label_style: TextStyle,
) -> ChipThemeData
pub fn from_defaults( brightness: Option<Brightness>, primary_color: Option<Color>, secondary_color: Color, label_style: TextStyle, ) -> ChipThemeData
Dart’s ChipThemeData.fromDefaults: generates a ChipThemeData from a brightness,
a primary color, a secondary color, and a text style.
Only one of primary_color or brightness may be given, and one of them must be:
brightness is derived from primary_color when that is given, and the primary color
is black or white from brightness when it is not.
The secondary_color is used for the selection state. The colors, opacities and
padding of the result are Material Design defaults.
Sourcepub fn color(
self,
color: WidgetStatePropertyRef<Option<Color>>,
) -> ChipThemeData
pub fn color( self, color: WidgetStatePropertyRef<Option<Color>>, ) -> ChipThemeData
Dart ChipThemeData(color:).
Sourcepub fn background_color(self, background_color: Color) -> ChipThemeData
pub fn background_color(self, background_color: Color) -> ChipThemeData
Dart ChipThemeData(backgroundColor:).
Sourcepub fn delete_icon_color(
self,
delete_icon_color: impl Into<AnyColor>,
) -> ChipThemeData
pub fn delete_icon_color( self, delete_icon_color: impl Into<AnyColor>, ) -> ChipThemeData
Dart ChipThemeData(deleteIconColor:).
Sourcepub fn disabled_color(self, disabled_color: Color) -> ChipThemeData
pub fn disabled_color(self, disabled_color: Color) -> ChipThemeData
Dart ChipThemeData(disabledColor:).
Sourcepub fn selected_color(self, selected_color: Color) -> ChipThemeData
pub fn selected_color(self, selected_color: Color) -> ChipThemeData
Dart ChipThemeData(selectedColor:).
Sourcepub fn secondary_selected_color(
self,
secondary_selected_color: Color,
) -> ChipThemeData
pub fn secondary_selected_color( self, secondary_selected_color: Color, ) -> ChipThemeData
Dart ChipThemeData(secondarySelectedColor:).
Sourcepub fn shadow_color(self, shadow_color: Color) -> ChipThemeData
pub fn shadow_color(self, shadow_color: Color) -> ChipThemeData
Dart ChipThemeData(shadowColor:).
Sourcepub fn surface_tint_color(self, surface_tint_color: Color) -> ChipThemeData
pub fn surface_tint_color(self, surface_tint_color: Color) -> ChipThemeData
Dart ChipThemeData(surfaceTintColor:).
Sourcepub fn selected_shadow_color(
self,
selected_shadow_color: Color,
) -> ChipThemeData
pub fn selected_shadow_color( self, selected_shadow_color: Color, ) -> ChipThemeData
Dart ChipThemeData(selectedShadowColor:).
Sourcepub fn show_checkmark(self, show_checkmark: bool) -> ChipThemeData
pub fn show_checkmark(self, show_checkmark: bool) -> ChipThemeData
Dart ChipThemeData(showCheckmark:).
Sourcepub fn checkmark_color(self, checkmark_color: Color) -> ChipThemeData
pub fn checkmark_color(self, checkmark_color: Color) -> ChipThemeData
Dart ChipThemeData(checkmarkColor:).
Sourcepub fn label_padding(
self,
label_padding: impl Into<EdgeInsetsGeometry>,
) -> ChipThemeData
pub fn label_padding( self, label_padding: impl Into<EdgeInsetsGeometry>, ) -> ChipThemeData
Dart ChipThemeData(labelPadding:).
Sourcepub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> ChipThemeData
pub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> ChipThemeData
Dart ChipThemeData(padding:).
Sourcepub fn side(self, side: impl Into<AnyBorderSide>) -> ChipThemeData
pub fn side(self, side: impl Into<AnyBorderSide>) -> ChipThemeData
Dart ChipThemeData(side:).
Sourcepub fn shape(self, shape: impl Into<OutlinedBorderRef>) -> ChipThemeData
pub fn shape(self, shape: impl Into<OutlinedBorderRef>) -> ChipThemeData
Dart ChipThemeData(shape:).
Sourcepub fn label_style(self, label_style: TextStyle) -> ChipThemeData
pub fn label_style(self, label_style: TextStyle) -> ChipThemeData
Dart ChipThemeData(labelStyle:).
Sourcepub fn secondary_label_style(
self,
secondary_label_style: TextStyle,
) -> ChipThemeData
pub fn secondary_label_style( self, secondary_label_style: TextStyle, ) -> ChipThemeData
Dart ChipThemeData(secondaryLabelStyle:).
Sourcepub fn brightness(self, brightness: Brightness) -> ChipThemeData
pub fn brightness(self, brightness: Brightness) -> ChipThemeData
Dart ChipThemeData(brightness:).
Sourcepub fn elevation(self, elevation: f64) -> ChipThemeData
pub fn elevation(self, elevation: f64) -> ChipThemeData
Dart ChipThemeData(elevation:).
Sourcepub fn press_elevation(self, press_elevation: f64) -> ChipThemeData
pub fn press_elevation(self, press_elevation: f64) -> ChipThemeData
Dart ChipThemeData(pressElevation:).
Sourcepub fn icon_theme(self, icon_theme: IconThemeData) -> ChipThemeData
pub fn icon_theme(self, icon_theme: IconThemeData) -> ChipThemeData
Dart ChipThemeData(iconTheme:).
Sourcepub fn avatar_box_constraints(
self,
avatar_box_constraints: BoxConstraints,
) -> ChipThemeData
pub fn avatar_box_constraints( self, avatar_box_constraints: BoxConstraints, ) -> ChipThemeData
Dart ChipThemeData(avatarBoxConstraints:).
Sourcepub fn delete_icon_box_constraints(
self,
delete_icon_box_constraints: BoxConstraints,
) -> ChipThemeData
pub fn delete_icon_box_constraints( self, delete_icon_box_constraints: BoxConstraints, ) -> ChipThemeData
Dart ChipThemeData(deleteIconBoxConstraints:).
Sourcepub fn copy_with(&self) -> ChipThemeData
pub fn copy_with(&self) -> ChipThemeData
Creates a copy of this object but with the given fields replaced with the new values.
Dart’s named arguments are the fluent setters on the copy
(data.copy_with().elevation(4.0)).
Sourcepub fn lerp(
a: Option<&ChipThemeData>,
b: Option<&ChipThemeData>,
t: f64,
) -> Option<ChipThemeData>
pub fn lerp( a: Option<&ChipThemeData>, b: Option<&ChipThemeData>, t: f64, ) -> Option<ChipThemeData>
Linearly interpolate between two chip themes.
{@macro dart.ui.shadow.lerp}
Trait Implementations§
Source§impl ChipThemeDataGetters for ChipThemeData
impl ChipThemeDataGetters for ChipThemeData
Source§fn chip_theme_data(&self) -> &ChipThemeData
fn chip_theme_data(&self) -> &ChipThemeData
super(...)
arguments a defaults struct keeps.Source§fn color(&self, app: &mut App) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn color(&self, app: &mut App) -> Option<WidgetStatePropertyRef<Option<Color>>>
color getter.Source§fn delete_icon_color(&self, app: &mut App) -> Option<AnyColor>
fn delete_icon_color(&self, app: &mut App) -> Option<AnyColor>
delete_icon_color getter.Source§fn secondary_selected_color(&self, app: &mut App) -> Option<Color>
fn secondary_selected_color(&self, app: &mut App) -> Option<Color>
secondary_selected_color getter.Source§fn surface_tint_color(&self, app: &mut App) -> Option<Color>
fn surface_tint_color(&self, app: &mut App) -> Option<Color>
surface_tint_color getter.Source§fn selected_shadow_color(&self, app: &mut App) -> Option<Color>
fn selected_shadow_color(&self, app: &mut App) -> Option<Color>
selected_shadow_color getter.Source§fn label_padding(&self, app: &mut App) -> Option<EdgeInsetsGeometry>
fn label_padding(&self, app: &mut App) -> Option<EdgeInsetsGeometry>
label_padding getter.Source§fn secondary_label_style(&self, app: &mut App) -> Option<TextStyle>
fn secondary_label_style(&self, app: &mut App) -> Option<TextStyle>
secondary_label_style getter.Source§fn brightness(&self, app: &mut App) -> Option<Brightness>
fn brightness(&self, app: &mut App) -> Option<Brightness>
brightness getter.Source§fn icon_theme(&self, app: &mut App) -> Option<IconThemeData>
fn icon_theme(&self, app: &mut App) -> Option<IconThemeData>
icon_theme getter.Source§fn avatar_box_constraints(&self, app: &mut App) -> Option<BoxConstraints>
fn avatar_box_constraints(&self, app: &mut App) -> Option<BoxConstraints>
avatar_box_constraints getter.Source§fn delete_icon_box_constraints(&self, app: &mut App) -> Option<BoxConstraints>
fn delete_icon_box_constraints(&self, app: &mut App) -> Option<BoxConstraints>
delete_icon_box_constraints getter.Source§fn copy_with(&self, app: &mut App) -> ChipThemeData
fn copy_with(&self, app: &mut App) -> ChipThemeData
copyWith() with no arguments: a plain value holding what every getter
answers, for the caller’s setters to change.Source§impl Clone for ChipThemeData
impl Clone for ChipThemeData
Source§impl Debug for ChipThemeData
impl Debug for ChipThemeData
Source§impl Default for ChipThemeData
impl Default for ChipThemeData
Source§impl Diagnosticable for ChipThemeData
impl Diagnosticable for ChipThemeData
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Object.runtimeType as diagnostics print it: the last segment of
the Rust type path, without generic arguments.Source§fn identity_hash(&self) -> u64
fn identity_hash(&self) -> u64
Object.hashCode as diagnostics print it: the object’s address.Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
Source§fn to_diagnostics_node(&self) -> DiagnosticableNode
fn to_diagnostics_node(&self) -> DiagnosticableNode
DiagnosticsNode::to_string_deep.Source§fn to_diagnostics_node_with(
&self,
name: Option<String>,
style: Option<DiagnosticsTreeStyle>,
) -> DiagnosticableNode
fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode
toDiagnosticsNode(name:, style:).Source§fn to_string(&self) -> String
fn to_string(&self) -> String
toString: a single-line description with properties and no
children. Read moreSource§fn to_string_at(&self, min_level: DiagnosticLevel) -> String
fn to_string_at(&self, min_level: DiagnosticLevel) -> String
toString(minLevel:).