pub struct CheckboxThemeData {
pub mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>,
pub fill_color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub check_color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub splash_radius: Option<f64>,
pub material_tap_target_size: Option<MaterialTapTargetSize>,
pub visual_density: Option<VisualDensity>,
pub shape: Option<OutlinedBorderRef>,
pub side: Option<AnyBorderSide>,
pub mark_insets: Option<EdgeInsets>,
}Expand description
Defines default property values for descendant Checkbox widgets.
Descendant widgets obtain the current CheckboxThemeData object using
CheckboxTheme::of. Instances of CheckboxThemeData can be
customized with CheckboxThemeData::copy_with.
Typically a CheckboxThemeData is specified as part of the overall Theme
with ThemeData::checkbox_theme.
All CheckboxThemeData properties are None by default. When null, the
Checkbox will use the values from ThemeData if they exist, otherwise it
will provide its own defaults based on the overall Theme’s color_scheme.
See the individual Checkbox properties for details.
See also:
ThemeData, which describes the overall theme information for the application.
Fields§
§mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>The cursor for a mouse pointer when it enters or is hovering over the widget.
If mouse_cursor is a WidgetStateMouseCursor,
WidgetStateProperty::resolve is used for the following WidgetStates:
WidgetState::Selected.WidgetState::Focused.WidgetState::Disabled.
If specified, overrides the default value of Checkbox::mouse_cursor.
fill_color: Option<WidgetStatePropertyRef<Option<Color>>>The color that fills the checkbox, in all WidgetStates.
Resolves in the following states:
WidgetState::Selected.WidgetState::Hovered.WidgetState::Focused.WidgetState::Disabled.
If specified, overrides the default value of Checkbox::fill_color.
check_color: Option<WidgetStatePropertyRef<Option<Color>>>The color to use for the check icon when this checkbox is checked.
Resolves in the following states:
WidgetState::Selected.WidgetState::Hovered.WidgetState::Focused.WidgetState::Disabled.
If specified, overrides the default value of Checkbox::check_color.
overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>The color for the checkbox’s Material.
Resolves in the following states:
WidgetState::Pressed.WidgetState::Selected.WidgetState::Hovered.WidgetState::Focused.
If specified, overrides the default value of Checkbox::overlay_color.
splash_radius: Option<f64>The splash radius of the circular Material ink response.
If specified, overrides the default value of Checkbox::splash_radius.
material_tap_target_size: Option<MaterialTapTargetSize>Configures the minimum size of the tap target.
If specified, overrides the default value of
Checkbox::material_tap_target_size.
visual_density: Option<VisualDensity>Defines how compact the checkbox’s layout will be.
If specified, overrides the default value of Checkbox::visual_density.
shape: Option<OutlinedBorderRef>The shape of the checkbox’s Material.
If specified, overrides the default value of Checkbox::shape.
side: Option<AnyBorderSide>The color and width of the checkbox’s border.
This property can be a WidgetStateBorderSide that can
specify different border color and widths depending on the
checkbox’s state.
Resolves in the following states:
WidgetState::Pressed.WidgetState::Selected.WidgetState::Hovered.WidgetState::Focused.WidgetState::Disabled.WidgetState::Error.
If this property is not a WidgetStateBorderSide and it is
non-null, then it is only rendered when the checkbox’s value is
false. The difference in interpretation is for backwards
compatibility.
If specified, overrides the default value of Checkbox::side.
mark_insets: Option<EdgeInsets>The insets applied around the check mark when the checkbox is checked or in its indeterminate (tristate) state.
This insets the check mark inward; the size of the checkbox box itself
is not affected. The check mark and its stroke shrink to fit the
remaining space, so the mark stays proportional. Its size is the smaller
of the remaining width and height, and it is centered in the remaining
space, so an inset on one axis also shrinks it on the other. For example,
EdgeInsets::only(9.0, 0.0, 0.0, 0.0) draws a half-size mark centered in the right
half of the box.
On iOS and macOS, when using Checkbox::adaptive, this property has no
effect, because the checkbox delegates to CupertinoCheckbox, which does
not support insets.
Must be non-negative. If the horizontal or vertical insets are greater than or equal to the checkbox size, the check mark or indeterminate dash is not painted.
If null, CheckboxThemeData::mark_insets is used. If that is also null,
it defaults to EdgeInsets::ZERO and the check mark renders at full size.
Implementations§
Source§impl CheckboxThemeData
impl CheckboxThemeData
Sourcepub fn new() -> CheckboxThemeData
pub fn new() -> CheckboxThemeData
Creates a theme that can be used for ThemeData::checkbox_theme; Dart’s optional
named arguments are the fluent setters.
Sourcepub fn mouse_cursor(
self,
mouse_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>,
) -> CheckboxThemeData
pub fn mouse_cursor( self, mouse_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>, ) -> CheckboxThemeData
Dart CheckboxThemeData(mouseCursor:).
Sourcepub fn fill_color(
self,
fill_color: WidgetStatePropertyRef<Option<Color>>,
) -> CheckboxThemeData
pub fn fill_color( self, fill_color: WidgetStatePropertyRef<Option<Color>>, ) -> CheckboxThemeData
Dart CheckboxThemeData(fillColor:).
Sourcepub fn check_color(
self,
check_color: WidgetStatePropertyRef<Option<Color>>,
) -> CheckboxThemeData
pub fn check_color( self, check_color: WidgetStatePropertyRef<Option<Color>>, ) -> CheckboxThemeData
Dart CheckboxThemeData(checkColor:).
Sourcepub fn overlay_color(
self,
overlay_color: WidgetStatePropertyRef<Option<Color>>,
) -> CheckboxThemeData
pub fn overlay_color( self, overlay_color: WidgetStatePropertyRef<Option<Color>>, ) -> CheckboxThemeData
Dart CheckboxThemeData(overlayColor:).
Sourcepub fn splash_radius(self, splash_radius: f64) -> CheckboxThemeData
pub fn splash_radius(self, splash_radius: f64) -> CheckboxThemeData
Dart CheckboxThemeData(splashRadius:).
Sourcepub fn material_tap_target_size(
self,
material_tap_target_size: MaterialTapTargetSize,
) -> CheckboxThemeData
pub fn material_tap_target_size( self, material_tap_target_size: MaterialTapTargetSize, ) -> CheckboxThemeData
Dart CheckboxThemeData(materialTapTargetSize:).
Sourcepub fn visual_density(self, visual_density: VisualDensity) -> CheckboxThemeData
pub fn visual_density(self, visual_density: VisualDensity) -> CheckboxThemeData
Dart CheckboxThemeData(visualDensity:).
Sourcepub fn shape(self, shape: impl Into<OutlinedBorderRef>) -> CheckboxThemeData
pub fn shape(self, shape: impl Into<OutlinedBorderRef>) -> CheckboxThemeData
Dart CheckboxThemeData(shape:).
Sourcepub fn side(self, side: impl Into<AnyBorderSide>) -> CheckboxThemeData
pub fn side(self, side: impl Into<AnyBorderSide>) -> CheckboxThemeData
Dart CheckboxThemeData(side:).
Sourcepub fn mark_insets(self, mark_insets: EdgeInsets) -> CheckboxThemeData
pub fn mark_insets(self, mark_insets: EdgeInsets) -> CheckboxThemeData
Dart CheckboxThemeData(markInsets:).
Sourcepub fn copy_with(&self) -> CheckboxThemeData
pub fn copy_with(&self) -> CheckboxThemeData
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().splash_radius(4.0)).
Sourcepub fn lerp(
a: Option<&CheckboxThemeData>,
b: Option<&CheckboxThemeData>,
t: f64,
) -> CheckboxThemeData
pub fn lerp( a: Option<&CheckboxThemeData>, b: Option<&CheckboxThemeData>, t: f64, ) -> CheckboxThemeData
Linearly interpolate between two CheckboxThemeDatas.
{@macro dart.ui.shadow.lerp}
Trait Implementations§
Source§impl CheckboxThemeDataGetters for CheckboxThemeData
impl CheckboxThemeDataGetters for CheckboxThemeData
Source§fn checkbox_theme_data(&self) -> &CheckboxThemeData
fn checkbox_theme_data(&self) -> &CheckboxThemeData
super(...)
arguments a defaults struct keeps.Source§fn mouse_cursor(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>
fn mouse_cursor( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>
mouse_cursor getter.Source§fn fill_color(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn fill_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>
fill_color getter.Source§fn check_color(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn check_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>
check_color getter.Source§fn overlay_color(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn overlay_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>
overlay_color getter.Source§fn material_tap_target_size(
&self,
app: &mut App,
) -> Option<MaterialTapTargetSize>
fn material_tap_target_size( &self, app: &mut App, ) -> Option<MaterialTapTargetSize>
material_tap_target_size getter.Source§fn visual_density(&self, app: &mut App) -> Option<VisualDensity>
fn visual_density(&self, app: &mut App) -> Option<VisualDensity>
visual_density getter.Source§fn mark_insets(&self, app: &mut App) -> Option<EdgeInsets>
fn mark_insets(&self, app: &mut App) -> Option<EdgeInsets>
mark_insets getter.Source§fn copy_with(&self, app: &mut App) -> CheckboxThemeData
fn copy_with(&self, app: &mut App) -> CheckboxThemeData
copyWith() with no arguments: a plain value holding what every getter
answers, for the caller’s setters to change.Source§impl Clone for CheckboxThemeData
impl Clone for CheckboxThemeData
Source§impl Debug for CheckboxThemeData
impl Debug for CheckboxThemeData
Source§impl Default for CheckboxThemeData
impl Default for CheckboxThemeData
Source§impl Diagnosticable for CheckboxThemeData
impl Diagnosticable for CheckboxThemeData
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:).