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.