pub struct CardThemeData {
pub clip_behavior: Option<Clip>,
pub color: Option<Color>,
pub shadow_color: Option<Color>,
pub surface_tint_color: Option<Color>,
pub elevation: Option<f64>,
pub margin: Option<EdgeInsetsGeometry>,
pub shape: Option<ShapeBorderRef>,
}Expand description
Defines default property values for descendant Card widgets.
Descendant widgets obtain the current CardThemeData object using
CardTheme::of(app, context). Instances of CardThemeData can be
customized with CardThemeData::copy_with.
Typically a CardThemeData is specified as part of the overall Theme
with ThemeData::card_theme.
All CardThemeData properties are null by default. When null, the Card
will use the values from ThemeData if they exist, otherwise it will
provide its own defaults. See the individual Card properties for details.
See also:
ThemeData, which describes the overall theme information for the application.
Fields§
§clip_behavior: Option<Clip>Overrides the default value for Card::clip_behavior.
color: Option<Color>Overrides the default value for Card::color.
shadow_color: Option<Color>Overrides the default value for Card::shadow_color.
surface_tint_color: Option<Color>Overrides the default value for Card::surface_tint_color.
elevation: Option<f64>Overrides the default value for Card::elevation.
margin: Option<EdgeInsetsGeometry>Overrides the default value for Card::margin.
shape: Option<ShapeBorderRef>Overrides the default value for Card::shape.
Implementations§
Source§impl CardThemeData
impl CardThemeData
Sourcepub fn new() -> CardThemeData
pub fn new() -> CardThemeData
Creates a theme that can be used for ThemeData::card_theme; Dart’s optional named
arguments are the fluent setters.
The elevation must be null or non-negative.
Sourcepub fn clip_behavior(self, clip_behavior: Clip) -> CardThemeData
pub fn clip_behavior(self, clip_behavior: Clip) -> CardThemeData
Dart CardThemeData(clipBehavior:).
Sourcepub fn color(self, color: Color) -> CardThemeData
pub fn color(self, color: Color) -> CardThemeData
Dart CardThemeData(color:).
Sourcepub fn shadow_color(self, shadow_color: Color) -> CardThemeData
pub fn shadow_color(self, shadow_color: Color) -> CardThemeData
Dart CardThemeData(shadowColor:).
Sourcepub fn surface_tint_color(self, surface_tint_color: Color) -> CardThemeData
pub fn surface_tint_color(self, surface_tint_color: Color) -> CardThemeData
Dart CardThemeData(surfaceTintColor:).
Sourcepub fn elevation(self, elevation: f64) -> CardThemeData
pub fn elevation(self, elevation: f64) -> CardThemeData
Dart CardThemeData(elevation:).
Sourcepub fn margin(self, margin: impl Into<EdgeInsetsGeometry>) -> CardThemeData
pub fn margin(self, margin: impl Into<EdgeInsetsGeometry>) -> CardThemeData
Dart CardThemeData(margin:).
Sourcepub fn shape(self, shape: impl Into<ShapeBorderRef>) -> CardThemeData
pub fn shape(self, shape: impl Into<ShapeBorderRef>) -> CardThemeData
Dart CardThemeData(shape:).
Sourcepub fn copy_with(&self) -> CardThemeData
pub fn copy_with(&self) -> CardThemeData
Creates a copy of this object with the given fields replaced with the new values.
Dart’s named arguments are the fluent setters on the copy
(data.copy_with().elevation(2.0)).
Sourcepub fn lerp(
a: Option<&CardThemeData>,
b: Option<&CardThemeData>,
t: f64,
) -> CardThemeData
pub fn lerp( a: Option<&CardThemeData>, b: Option<&CardThemeData>, t: f64, ) -> CardThemeData
Linearly interpolate between two Card themes.
{@macro dart.ui.shadow.lerp}
Trait Implementations§
Source§impl CardThemeDataGetters for CardThemeData
impl CardThemeDataGetters for CardThemeData
Source§fn card_theme_data(&self) -> &CardThemeData
fn card_theme_data(&self) -> &CardThemeData
super(...)
arguments a defaults struct keeps.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 copy_with(&self, app: &mut App) -> CardThemeData
fn copy_with(&self, app: &mut App) -> CardThemeData
copyWith() with no arguments: a plain value holding what every getter
answers, for the caller’s setters to change.Source§impl Clone for CardThemeData
impl Clone for CardThemeData
Source§impl Debug for CardThemeData
impl Debug for CardThemeData
Source§impl Default for CardThemeData
impl Default for CardThemeData
Source§impl Diagnosticable for CardThemeData
impl Diagnosticable for CardThemeData
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:).