pub struct DialogTheme {
pub key: Option<KeyRef>,
/* private fields */
}Expand description
Defines a theme for Dialog widgets.
Descendant widgets obtain the current DialogThemeData object using
DialogTheme::of. Instances of DialogThemeData can be customized with
DialogThemeData::copy_with.
title_text_style and
content_text_style are used in AlertDialogs and
SimpleDialogs.
Dart’s DialogTheme 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:
Dialog, a dialog that can be customized using thisDialogTheme.AlertDialog, a dialog that can be customized using thisDialogTheme.SimpleDialog, a dialog that can be customized using thisDialogTheme.ThemeData, which describes the overall theme information for the application.
Fields§
§key: Option<KeyRef>Implementations§
Source§impl DialogTheme
impl DialogTheme
Sourcepub fn new() -> DialogTheme
pub fn new() -> DialogTheme
Creates a dialog theme that can be used for ThemeData::dialog_theme.
Sourcepub fn key(self, key: KeyRef) -> DialogTheme
pub fn key(self, key: KeyRef) -> DialogTheme
Dart DialogTheme(key:).
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> DialogTheme
pub fn child<K>(self, child: impl IntoWidget<K>) -> DialogTheme
Dart DialogTheme(child:); the default is an empty SizedBox.
Sourcepub fn with_data(self, data: DialogThemeData) -> DialogTheme
pub fn with_data(self, data: DialogThemeData) -> DialogTheme
Dart DialogTheme(data:).
Sourcepub fn with_background_color(self, background_color: Color) -> DialogTheme
pub fn with_background_color(self, background_color: Color) -> DialogTheme
Dart DialogTheme(backgroundColor:).
Sourcepub fn with_elevation(self, elevation: f64) -> DialogTheme
pub fn with_elevation(self, elevation: f64) -> DialogTheme
Dart DialogTheme(elevation:).
Sourcepub fn with_shadow_color(self, shadow_color: Color) -> DialogTheme
pub fn with_shadow_color(self, shadow_color: Color) -> DialogTheme
Dart DialogTheme(shadowColor:).
Sourcepub fn with_surface_tint_color(self, surface_tint_color: Color) -> DialogTheme
pub fn with_surface_tint_color(self, surface_tint_color: Color) -> DialogTheme
Dart DialogTheme(surfaceTintColor:).
Sourcepub fn with_shape(self, shape: impl Into<ShapeBorderRef>) -> DialogTheme
pub fn with_shape(self, shape: impl Into<ShapeBorderRef>) -> DialogTheme
Dart DialogTheme(shape:).
Sourcepub fn with_alignment(self, alignment: AlignmentGeometry) -> DialogTheme
pub fn with_alignment(self, alignment: AlignmentGeometry) -> DialogTheme
Dart DialogTheme(alignment:).
Sourcepub fn with_icon_color(self, icon_color: Color) -> DialogTheme
pub fn with_icon_color(self, icon_color: Color) -> DialogTheme
Dart DialogTheme(iconColor:).
Sourcepub fn with_title_text_style(self, title_text_style: TextStyle) -> DialogTheme
pub fn with_title_text_style(self, title_text_style: TextStyle) -> DialogTheme
Dart DialogTheme(titleTextStyle:).
Sourcepub fn with_content_text_style(
self,
content_text_style: TextStyle,
) -> DialogTheme
pub fn with_content_text_style( self, content_text_style: TextStyle, ) -> DialogTheme
Dart DialogTheme(contentTextStyle:).
Sourcepub fn with_actions_padding(
self,
actions_padding: impl Into<EdgeInsetsGeometry>,
) -> DialogTheme
pub fn with_actions_padding( self, actions_padding: impl Into<EdgeInsetsGeometry>, ) -> DialogTheme
Dart DialogTheme(actionsPadding:).
Sourcepub fn with_barrier_color(self, barrier_color: Color) -> DialogTheme
pub fn with_barrier_color(self, barrier_color: Color) -> DialogTheme
Dart DialogTheme(barrierColor:).
Sourcepub fn with_inset_padding(self, inset_padding: EdgeInsets) -> DialogTheme
pub fn with_inset_padding(self, inset_padding: EdgeInsets) -> DialogTheme
Dart DialogTheme(insetPadding:).
Sourcepub fn with_clip_behavior(self, clip_behavior: Clip) -> DialogTheme
pub fn with_clip_behavior(self, clip_behavior: Clip) -> DialogTheme
Dart DialogTheme(clipBehavior:).
Sourcepub fn background_color(&self) -> Option<Color>
pub fn background_color(&self) -> Option<Color>
Overrides the default value for Dialog::background_color.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::background_color property in data
instead.
Sourcepub fn elevation(&self) -> Option<f64>
pub fn elevation(&self) -> Option<f64>
Overrides the default value for Dialog::elevation.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::elevation property in data instead.
Sourcepub fn shadow_color(&self) -> Option<Color>
pub fn shadow_color(&self) -> Option<Color>
Overrides the default value for Dialog::shadow_color.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::shadow_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 Dialog::surface_tint_color.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::surface_tint_color property in data
instead.
Sourcepub fn shape(&self) -> Option<&ShapeBorderRef>
pub fn shape(&self) -> Option<&ShapeBorderRef>
Overrides the default value for Dialog::shape.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::shape property in data instead.
Sourcepub fn alignment(&self) -> Option<AlignmentGeometry>
pub fn alignment(&self) -> Option<AlignmentGeometry>
Overrides the default value for Dialog::alignment.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::alignment property in data instead.
Sourcepub fn title_text_style(&self) -> Option<&TextStyle>
pub fn title_text_style(&self) -> Option<&TextStyle>
Overrides the default value for DefaultTextStyle for SimpleDialog::title and
AlertDialog::title.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::title_text_style property in data
instead.
Sourcepub fn content_text_style(&self) -> Option<&TextStyle>
pub fn content_text_style(&self) -> Option<&TextStyle>
Overrides the default value for DefaultTextStyle for SimpleDialog::children and
AlertDialog::content.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::content_text_style property in data
instead.
Sourcepub fn actions_padding(&self) -> Option<EdgeInsetsGeometry>
pub fn actions_padding(&self) -> Option<EdgeInsetsGeometry>
Overrides the default value for AlertDialog::actions_padding.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::actions_padding property in data
instead.
Sourcepub fn icon_color(&self) -> Option<Color>
pub fn icon_color(&self) -> Option<Color>
Used to configure the IconTheme for the AlertDialog::icon widget.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::icon_color property in data instead.
Sourcepub fn barrier_color(&self) -> Option<Color>
pub fn barrier_color(&self) -> Option<Color>
Overrides the default value for barrier_color in ShowDialog.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::barrier_color property in data
instead.
Sourcepub fn inset_padding(&self) -> Option<EdgeInsets>
pub fn inset_padding(&self) -> Option<EdgeInsets>
Overrides the default value for Dialog::inset_padding.
Sourcepub fn clip_behavior(&self) -> Option<Clip>
pub fn clip_behavior(&self) -> Option<Clip>
Overrides the default value of Dialog::clip_behavior.
This property is obsolete and will be deprecated in a future release:
please use the DialogThemeData::clip_behavior property in data
instead.
Sourcepub fn data(&self) -> DialogThemeData
pub fn data(&self) -> DialogThemeData
The properties used for all descendant Dialog widgets.
Sourcepub fn of(app: &mut App, context: BuildContext) -> DialogThemeData
pub fn of(app: &mut App, context: BuildContext) -> DialogThemeData
Retrieves the DialogThemeData from the closest ancestor DialogTheme.
If there is no enclosing DialogTheme widget, then
Theme::of(context).dialog_theme is used.
Sourcepub fn copy_with(&self) -> DialogTheme
pub fn copy_with(&self) -> DialogTheme
Creates a copy of this object but with the given fields replaced with the new values.
This method is obsolete and will be deprecated in a future release:
please use the DialogThemeData::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 lerp(
a: Option<&DialogTheme>,
b: Option<&DialogTheme>,
t: f64,
) -> DialogTheme
pub fn lerp( a: Option<&DialogTheme>, b: Option<&DialogTheme>, t: f64, ) -> DialogTheme
Linearly interpolate between two dialog themes.
{@macro dart.ui.shadow.lerp}
This method is obsolete and will be deprecated in a future release:
please use the DialogThemeData::lerp instead.
Trait Implementations§
Source§impl Clone for DialogTheme
impl Clone for DialogTheme
Source§impl Debug for DialogTheme
impl Debug for DialogTheme
Source§impl Default for DialogTheme
impl Default for DialogTheme
Source§fn default() -> DialogTheme
fn default() -> DialogTheme
Source§impl InheritedTheme for DialogTheme
impl InheritedTheme for DialogTheme
Source§impl InheritedWidget for DialogTheme
impl InheritedWidget for DialogTheme
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: &DialogTheme) -> bool
fn update_should_notify(&self, old_widget: &DialogTheme) -> bool
Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
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 DialogTheme
impl !Send for DialogTheme
impl !Sync for DialogTheme
impl !UnwindSafe for DialogTheme
impl Forget for DialogTheme
impl Freeze for DialogThemewhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn ShapeBorder> is !null: Freeze,
PhantomData<RcInner<dyn ShapeBorder>>: 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 Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for DialogTheme
impl Unpin for DialogTheme
impl UnsafeUnpin for DialogThemewhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn ShapeBorder> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ShapeBorder>>: 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 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.