pub struct CardTheme {
pub key: Option<KeyRef>,
/* private fields */
}Expand description
Defines default property values for descendant Card widgets.
Descendant widgets obtain the current CardThemeData object using
CardTheme::of. 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.
Dart’s CardTheme constructor takes either the properties or a data;
here the properties are the with_* setters and with_data the other,
and each setter that breaks Dart’s constructor assert (a data together with any property)
fails in a debug build. The getters are methods, as Dart’s, hence the with_ prefix.
See also:
ThemeData, which describes the overall theme information for the application.
Fields§
§key: Option<KeyRef>Implementations§
Source§impl CardTheme
impl CardTheme
Sourcepub fn new() -> CardTheme
pub fn new() -> CardTheme
Creates a theme that can be used for ThemeData::card_theme.
The elevation must be null or non-negative.
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> CardTheme
pub fn child<K>(self, child: impl IntoWidget<K>) -> CardTheme
Dart CardTheme(child:); the default is an empty SizedBox.
Sourcepub fn with_data(self, data: CardThemeData) -> CardTheme
pub fn with_data(self, data: CardThemeData) -> CardTheme
Dart CardTheme(data:).
Sourcepub fn with_clip_behavior(self, clip_behavior: Clip) -> CardTheme
pub fn with_clip_behavior(self, clip_behavior: Clip) -> CardTheme
Dart CardTheme(clipBehavior:).
Sourcepub fn with_color(self, color: Color) -> CardTheme
pub fn with_color(self, color: Color) -> CardTheme
Dart CardTheme(color:).
Sourcepub fn with_surface_tint_color(self, surface_tint_color: Color) -> CardTheme
pub fn with_surface_tint_color(self, surface_tint_color: Color) -> CardTheme
Dart CardTheme(surfaceTintColor:).
Sourcepub fn with_shadow_color(self, shadow_color: Color) -> CardTheme
pub fn with_shadow_color(self, shadow_color: Color) -> CardTheme
Dart CardTheme(shadowColor:).
Sourcepub fn with_elevation(self, elevation: f64) -> CardTheme
pub fn with_elevation(self, elevation: f64) -> CardTheme
Dart CardTheme(elevation:).
Sourcepub fn with_margin(self, margin: impl Into<EdgeInsetsGeometry>) -> CardTheme
pub fn with_margin(self, margin: impl Into<EdgeInsetsGeometry>) -> CardTheme
Dart CardTheme(margin:).
Sourcepub fn with_shape(self, shape: impl Into<ShapeBorderRef>) -> CardTheme
pub fn with_shape(self, shape: impl Into<ShapeBorderRef>) -> CardTheme
Dart CardTheme(shape:).
Sourcepub fn clip_behavior(&self) -> Option<Clip>
pub fn clip_behavior(&self) -> Option<Clip>
Overrides the default value for Card::clip_behavior.
This property is obsolete and will be deprecated in a future release:
please use the CardThemeData::clip_behavior property in data instead.
Sourcepub fn color(&self) -> Option<Color>
pub fn color(&self) -> Option<Color>
Overrides the default value for Card::color.
This property is obsolete and will be deprecated in a future release:
please use the CardThemeData::color property in data instead.
Sourcepub fn surface_tint_color(&self) -> Option<Color>
pub fn surface_tint_color(&self) -> Option<Color>
Overrides the default value for Card::surface_tint_color.
This property is obsolete and will be deprecated in a future release:
please use the CardThemeData::surface_tint_color property in data
instead.
Sourcepub fn shadow_color(&self) -> Option<Color>
pub fn shadow_color(&self) -> Option<Color>
Overrides the default value for Card::shadow_color.
This property is obsolete and will be deprecated in a future release:
please use the CardThemeData::shadow_color property in data instead.
Sourcepub fn elevation(&self) -> Option<f64>
pub fn elevation(&self) -> Option<f64>
Overrides the default value for Card::elevation.
This property is obsolete and will be deprecated in a future release:
please use the CardThemeData::elevation property in data instead.
Sourcepub fn margin(&self) -> Option<EdgeInsetsGeometry>
pub fn margin(&self) -> Option<EdgeInsetsGeometry>
Overrides the default value for Card::margin.
This property is obsolete and will be deprecated in a future release:
please use the CardThemeData::margin property in data instead.
Sourcepub fn shape(&self) -> Option<&ShapeBorderRef>
pub fn shape(&self) -> Option<&ShapeBorderRef>
Overrides the default value for Card::shape.
This property is obsolete and will be deprecated in a future release:
please use the CardThemeData::shape property in data instead.
Sourcepub fn data(&self) -> CardThemeData
pub fn data(&self) -> CardThemeData
The properties used for all descendant Card widgets.
Sourcepub fn copy_with(&self) -> CardTheme
pub fn copy_with(&self) -> CardTheme
Creates a copy of this object with the given fields replaced with the new values.
This method is obsolete and will be deprecated in a future release:
please use the CardThemeData::copy_with instead.
Dart’s named arguments are the fluent setters on the copy
(theme.copy_with().with_elevation(2.0)). As in Dart, the copy carries neither the key
nor the child, and holds the properties, never a data.
Sourcepub fn of(app: &mut App, context: BuildContext) -> CardThemeData
pub fn of(app: &mut App, context: BuildContext) -> CardThemeData
Trait Implementations§
Source§impl InheritedWidget for CardTheme
impl InheritedWidget for CardTheme
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 update_should_notify(&self, old_widget: &CardTheme) -> bool
fn update_should_notify(&self, old_widget: &CardTheme) -> bool
Source§fn as_inherited_theme(&self) -> Option<&(dyn InheritedTheme + 'static)>
fn as_inherited_theme(&self) -> Option<&(dyn InheritedTheme + 'static)>
this is InheritedTheme: an inherited widget that is an InheritedTheme
answers with itself, which is what InheritedTheme::capture collects.Auto Trait Implementations§
impl !RefUnwindSafe for CardTheme
impl !Send for CardTheme
impl !Sync for CardTheme
impl !UnwindSafe for CardTheme
impl Forget for CardTheme
impl Freeze for CardThemewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn ShapeBorder> is !null: Freeze,
PhantomData<RcInner<dyn ShapeBorder>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for CardTheme
impl Unpin for CardTheme
impl UnsafeUnpin for CardThemewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn ShapeBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ShapeBorder>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: 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<InheritedKind> for Wwhere
W: InheritedWidget,
impl<W> IntoWidget<InheritedKind> for Wwhere
W: InheritedWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.