Skip to main content

DrawerTheme

Struct DrawerTheme 

Source
pub struct DrawerTheme {
    pub shape: Option<ShapeBorder>,
    pub end_shape: Option<ShapeBorder>,
    pub width: Option<f32>,
    pub background_color: Option<Color>,
    pub border_color: Option<Color>,
    pub border_width: Option<f32>,
    pub radius: Option<f32>,
    pub elevation: Option<f32>,
    pub shadow_color: Option<Color>,
    pub scrim_color: Option<Color>,
}
Expand description

Defaults for Drawer.

The rounding is on the inner edge only — the one that meets the content — and the outer edge stays square against the window it is docked to, which is what the reference’s own shape resolves to. Which edge that is follows the direction: the panel does not know which side of the screen it landed on until it paints.

Fields§

§shape: Option<ShapeBorder>

What shape a leading panel is — the reference’s DrawerThemeData.shape (drawer.dart:268). Unset, the framework rounds the panel’s inner edge by DRAWER_RADIUS.

§end_shape: Option<ShapeBorder>

And a trailing one — the reference’s endShape (drawer.dart:269), which is a separate field rather than a mirror of the first because a panel’s rounded edge is the one facing the page, and that is the opposite side.

A trailing panel does not fall back to shape: a theme that named only the leading panel’s shape has said nothing about the other one, and the framework’s own default is a better answer than a shape rounded on the wrong edge.

§width: Option<f32>

The panel’s width.

§background_color: Option<Color>

The panel’s fill.

§border_color: Option<Color>

The hairline on the panel’s inner edge.

§border_width: Option<f32>

That hairline’s thickness; 0.0 removes it.

§radius: Option<f32>

The rounding of the inner edge’s two corners — the edge that meets the content. The outer one stays square against the window.

§elevation: Option<f32>

How far off the surface the panel sits. 0.0 casts no shadow, and neither does a height with no shadow_color.

§shadow_color: Option<Color>

The shadow’s colour. Unset, transparent, as the reference’s Material 3 drawer is (its defaults, line 795): a panel is lifted by its tone, and shadowed only on request.

§scrim_color: Option<Color>

The scrim behind a modal panel, alpha included.

Trait Implementations§

Source§

impl Clone for DrawerTheme

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 Copy for DrawerTheme

Source§

impl Debug for DrawerTheme

Source§

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

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

impl Default for DrawerTheme

Source§

fn default() -> Self

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

impl PartialEq for DrawerTheme

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DrawerTheme

Auto Trait Implementations§

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<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> 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<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
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.