pub struct SliverSafeArea {
pub key: Option<KeyRef>,
pub left: bool,
pub top: bool,
pub right: bool,
pub bottom: bool,
pub minimum: EdgeInsets,
pub sliver: WidgetRef,
}Expand description
A sliver that insets another sliver by sufficient padding to avoid intrusions by the operating system.
For example, this will indent the sliver by enough to avoid the status bar at the top of the screen.
It will also indent the sliver by the amount necessary to avoid The Notch on the iPhone X, or other similar creative physical features of the display.
When a minimum padding is specified, the greater of the minimum padding or
the safe area padding will be applied.
See also:
SafeArea, for insetting box widgets to avoid operating system intrusions.SliverPadding, for insetting slivers in general.MediaQuery, from which the window padding is obtained.
Fields§
§key: Option<KeyRef>§left: boolWhether to avoid system intrusions on the left.
top: boolWhether to avoid system intrusions at the top of the screen, typically the system status bar.
right: boolWhether to avoid system intrusions on the right.
bottom: boolWhether to avoid system intrusions on the bottom side of the screen.
minimum: EdgeInsetsThis minimum padding to apply.
The greater of the minimum padding and the media padding is be applied.
sliver: WidgetRefThe sliver below this sliver in the tree.
The padding on the MediaQuery for the sliver will be suitably adjusted to zero out any
sides that were avoided by this sliver.
Implementations§
Source§impl SliverSafeArea
impl SliverSafeArea
Sourcepub fn new<K>(sliver: impl IntoWidget<K>) -> SliverSafeArea
pub fn new<K>(sliver: impl IntoWidget<K>) -> SliverSafeArea
Creates a sliver that avoids operating system interfaces.
Sourcepub fn key(self, key: KeyRef) -> SliverSafeArea
pub fn key(self, key: KeyRef) -> SliverSafeArea
Dart SliverSafeArea(key:).
Sourcepub fn left(self, left: bool) -> SliverSafeArea
pub fn left(self, left: bool) -> SliverSafeArea
Dart SliverSafeArea(left:).
Sourcepub fn top(self, top: bool) -> SliverSafeArea
pub fn top(self, top: bool) -> SliverSafeArea
Dart SliverSafeArea(top:).
Sourcepub fn right(self, right: bool) -> SliverSafeArea
pub fn right(self, right: bool) -> SliverSafeArea
Dart SliverSafeArea(right:).
Sourcepub fn bottom(self, bottom: bool) -> SliverSafeArea
pub fn bottom(self, bottom: bool) -> SliverSafeArea
Dart SliverSafeArea(bottom:).
Sourcepub fn minimum(self, minimum: EdgeInsets) -> SliverSafeArea
pub fn minimum(self, minimum: EdgeInsets) -> SliverSafeArea
Dart SliverSafeArea(minimum:).
Trait Implementations§
Source§impl Debug for SliverSafeArea
impl Debug for SliverSafeArea
Source§impl StatelessWidget for SliverSafeArea
impl StatelessWidget for SliverSafeArea
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 build(&self, app: &mut App, context: BuildContext) -> WidgetRef
fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef
Source§fn debug_check_constructor(&self)
fn debug_check_constructor(&self)
Source§fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
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 SliverSafeArea
impl !Send for SliverSafeArea
impl !Sync for SliverSafeArea
impl !UnwindSafe for SliverSafeArea
impl Forget for SliverSafeArea
impl Freeze for SliverSafeArea
impl Move for SliverSafeArea
impl Unpin for SliverSafeArea
impl UnsafeUnpin for SliverSafeAreawhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: 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.