pub struct DrawerHeader {
pub key: Option<KeyRef>,
pub decoration: Option<DecorationRef>,
pub padding: EdgeInsetsGeometry,
pub margin: Option<EdgeInsetsGeometry>,
pub duration: Duration,
pub curve: Rc<dyn Curve>,
pub child: Option<WidgetRef>,
}Expand description
The top-most region of a Material Design drawer. The header’s child
widget, if any, is placed inside a Container whose decoration can be
passed as an argument, inset by the given padding.
Part of the Material Design Drawer.
Requires one of its ancestors to be a Material widget. This condition is
satisfied by putting the DrawerHeader in a Drawer.
See also:
UserAccountsDrawerHeader, a variant ofDrawerHeaderthat is specialized for showing user accounts.- https://material.io/design/components/navigation-drawer.html
Fields§
§key: Option<KeyRef>§decoration: Option<DecorationRef>Decoration for the main drawer header Container; useful for applying
backgrounds.
This decoration will extend under the system status bar.
If this is changed, it will be animated according to duration and
curve.
padding: EdgeInsetsGeometryThe padding by which to inset child.
The DrawerHeader additionally offsets the child by the height of the
system status bar.
If the child is null, the padding has no effect.
margin: Option<EdgeInsetsGeometry>The margin around the drawer header.
duration: DurationThe duration for animations of the decoration.
curve: Rc<dyn Curve>The curve for animations of the decoration.
child: Option<WidgetRef>A widget to be placed inside the drawer header, inset by the padding.
This widget will be sized to the size of the header. To position the child
precisely, consider using an Align or Center widget.
Implementations§
Source§impl DrawerHeader
impl DrawerHeader
Sourcepub fn new(child: Option<WidgetRef>) -> DrawerHeader
pub fn new(child: Option<WidgetRef>) -> DrawerHeader
Creates a Material Design drawer header; Dart’s optional named arguments are the setters.
Requires one of its ancestors to be a Material widget.
Sourcepub fn key(self, key: KeyRef) -> DrawerHeader
pub fn key(self, key: KeyRef) -> DrawerHeader
Dart DrawerHeader(key:).
Sourcepub fn decoration(self, decoration: impl Into<DecorationRef>) -> DrawerHeader
pub fn decoration(self, decoration: impl Into<DecorationRef>) -> DrawerHeader
Dart DrawerHeader(decoration:).
Sourcepub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> DrawerHeader
pub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> DrawerHeader
Dart DrawerHeader(padding:).
Sourcepub fn margin(self, margin: Option<EdgeInsetsGeometry>) -> DrawerHeader
pub fn margin(self, margin: Option<EdgeInsetsGeometry>) -> DrawerHeader
Dart DrawerHeader(margin:).
Sourcepub fn duration(self, duration: Duration) -> DrawerHeader
pub fn duration(self, duration: Duration) -> DrawerHeader
Dart DrawerHeader(duration:).
Sourcepub fn curve(self, curve: Rc<dyn Curve>) -> DrawerHeader
pub fn curve(self, curve: Rc<dyn Curve>) -> DrawerHeader
Dart DrawerHeader(curve:).
Trait Implementations§
Source§impl Debug for DrawerHeader
impl Debug for DrawerHeader
Source§impl StatelessWidget for DrawerHeader
impl StatelessWidget for DrawerHeader
Source§fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
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 debug_check_constructor(&self)
fn debug_check_constructor(&self)
Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
impl !RefUnwindSafe for DrawerHeader
impl !Send for DrawerHeader
impl !Sync for DrawerHeader
impl !UnwindSafe for DrawerHeader
impl Forget for DrawerHeader
impl Freeze for DrawerHeaderwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Decoration> is !null: Freeze,
PhantomData<RcInner<dyn Decoration>>: Freeze,
*const RcInner<dyn Curve> is !null: Freeze,
PhantomData<RcInner<dyn Curve>>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for DrawerHeader
impl Unpin for DrawerHeader
impl UnsafeUnpin for DrawerHeaderwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Decoration> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Decoration>>: UnsafeUnpin,
*const RcInner<dyn Curve> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Curve>>: 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<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.