pub struct DrawerTheme {
pub key: Option<KeyRef>,
pub data: DrawerThemeData,
pub child: WidgetRef,
}Expand description
An inherited widget that defines visual properties for Drawers in this
widget’s subtree.
Values specified here are used for Drawer properties that are not
given an explicit non-null value.
Using this would allow you to override the ThemeData::drawer_theme.
Fields§
§key: Option<KeyRef>§data: DrawerThemeDataSpecifies the background color, scrim color, elevation, and shape for
descendant Drawer widgets.
child: WidgetRefImplementations§
Source§impl DrawerTheme
impl DrawerTheme
Sourcepub fn new<K>(data: DrawerThemeData, child: impl IntoWidget<K>) -> DrawerTheme
pub fn new<K>(data: DrawerThemeData, child: impl IntoWidget<K>) -> DrawerTheme
Creates a theme that defines the DrawerThemeData properties for a
Drawer.
Sourcepub fn key(self, key: KeyRef) -> DrawerTheme
pub fn key(self, key: KeyRef) -> DrawerTheme
Dart DrawerTheme(key:).
Sourcepub fn of(app: &mut App, context: BuildContext) -> DrawerThemeData
pub fn of(app: &mut App, context: BuildContext) -> DrawerThemeData
Retrieves the DrawerThemeData from the closest ancestor DrawerTheme.
If there is no enclosing DrawerTheme widget, then
ThemeData::drawer_theme is used.
Typical usage is as follows:
let theme = DrawerTheme::of(app, context);Trait Implementations§
Source§impl Debug for DrawerTheme
impl Debug for DrawerTheme
Source§impl InheritedTheme for DrawerTheme
impl InheritedTheme for DrawerTheme
Source§impl InheritedWidget for DrawerTheme
impl InheritedWidget for DrawerTheme
Source§fn update_should_notify(&self, old_widget: &DrawerTheme) -> bool
fn update_should_notify(&self, old_widget: &DrawerTheme) -> bool
Whether the framework should notify widgets that inherit from this widget. Read more
Source§fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme>
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_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
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.Auto Trait Implementations§
impl !RefUnwindSafe for DrawerTheme
impl !Send for DrawerTheme
impl !Sync for DrawerTheme
impl !UnwindSafe for DrawerTheme
impl Forget for DrawerTheme
impl Freeze for DrawerThemewhere
*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 DrawerTheme
impl Unpin for DrawerTheme
impl UnsafeUnpin for DrawerThemewhere
*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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
The widget as a tree node, made where this is called: its
creation_location.