Skip to main content

DialogTheme

Struct DialogTheme 

Source
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 this DialogTheme.
  • AlertDialog, a dialog that can be customized using this DialogTheme.
  • SimpleDialog, a dialog that can be customized using this DialogTheme.
  • ThemeData, which describes the overall theme information for the application.

Fields§

§key: Option<KeyRef>

Implementations§

Source§

impl DialogTheme

Source

pub fn new() -> DialogTheme

Creates a dialog theme that can be used for ThemeData::dialog_theme.

Source

pub fn key(self, key: KeyRef) -> DialogTheme

Dart DialogTheme(key:).

Source

pub fn child<K>(self, child: impl IntoWidget<K>) -> DialogTheme

Dart DialogTheme(child:); the default is an empty SizedBox.

Source

pub fn with_data(self, data: DialogThemeData) -> DialogTheme

Dart DialogTheme(data:).

Source

pub fn with_background_color(self, background_color: Color) -> DialogTheme

Dart DialogTheme(backgroundColor:).

Source

pub fn with_elevation(self, elevation: f64) -> DialogTheme

Dart DialogTheme(elevation:).

Source

pub fn with_shadow_color(self, shadow_color: Color) -> DialogTheme

Dart DialogTheme(shadowColor:).

Source

pub fn with_surface_tint_color(self, surface_tint_color: Color) -> DialogTheme

Dart DialogTheme(surfaceTintColor:).

Source

pub fn with_shape(self, shape: impl Into<ShapeBorderRef>) -> DialogTheme

Dart DialogTheme(shape:).

Source

pub fn with_alignment(self, alignment: AlignmentGeometry) -> DialogTheme

Dart DialogTheme(alignment:).

Source

pub fn with_icon_color(self, icon_color: Color) -> DialogTheme

Dart DialogTheme(iconColor:).

Source

pub fn with_title_text_style(self, title_text_style: TextStyle) -> DialogTheme

Dart DialogTheme(titleTextStyle:).

Source

pub fn with_content_text_style( self, content_text_style: TextStyle, ) -> DialogTheme

Dart DialogTheme(contentTextStyle:).

Source

pub fn with_actions_padding( self, actions_padding: impl Into<EdgeInsetsGeometry>, ) -> DialogTheme

Dart DialogTheme(actionsPadding:).

Source

pub fn with_barrier_color(self, barrier_color: Color) -> DialogTheme

Dart DialogTheme(barrierColor:).

Source

pub fn with_inset_padding(self, inset_padding: EdgeInsets) -> DialogTheme

Dart DialogTheme(insetPadding:).

Source

pub fn with_clip_behavior(self, clip_behavior: Clip) -> DialogTheme

Dart DialogTheme(clipBehavior:).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn inset_padding(&self) -> Option<EdgeInsets>

Overrides the default value for Dialog::inset_padding.

Source

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.

Source

pub fn data(&self) -> DialogThemeData

The properties used for all descendant Dialog widgets.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DialogTheme

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DialogTheme

Source§

fn default() -> DialogTheme

Returns the “default value” for a type. Read more
Source§

impl InheritedTheme for DialogTheme

Source§

fn wrap( &self, _app: &mut App, _context: BuildContext, child: WidgetRef, ) -> WidgetRef

Return a copy of this inherited theme with the specified child. Read more
Source§

impl InheritedWidget for DialogTheme

Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s 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 child(&self) -> &WidgetRef

The widget below this widget in the tree.
Source§

fn update_should_notify(&self, old_widget: &DialogTheme) -> bool

Whether the framework should notify widgets that inherit from this widget. Read more
Source§

fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>

Dart’s this is InheritedTheme: an inherited widget that is an InheritedTheme answers with itself, which is what InheritedTheme::capture collects.
Source§

fn debug_check_constructor(&self)

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 DialogTheme
where *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
where Rc<dyn Key>: Unpin, Rc<dyn ShapeBorder>: Unpin, &'static dyn ColorExtension: Unpin, Rc<dyn ColorExtension>: Unpin, *const u8 is !null: Unpin, Rc<Paint>: Unpin, Rc<dyn Widget>: Unpin,

§

impl UnsafeUnpin for DialogTheme

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W> IntoWidget<InheritedKind> for W
where W: InheritedWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>