Skip to main content

ModalBarrier

Struct ModalBarrier 

Source
pub struct ModalBarrier {
    pub key: Option<KeyRef>,
    pub color: Option<Color>,
    pub dismissible: bool,
    pub on_dismiss: Option<Listener>,
    pub barrier_semantics_dismissible: Option<bool>,
    pub semantics_label: Option<String>,
    pub clip_details_notifier: Option<Ref<ValueNotifier<EdgeInsets>>>,
    pub semantics_on_tap_hint: Option<String>,
}
Expand description

A widget that prevents the user from interacting with widgets behind itself.

The modal barrier is the scrim that is rendered behind each route, which generally prevents the user from interacting with the route below the current route, and normally partially obscures such routes.

For example, when a dialog is on the screen, the page below the dialog is usually darkened by the modal barrier.

See also:

Fields§

§key: Option<KeyRef>§color: Option<Color>

If non-None, fill the barrier with this color.

§dismissible: bool

Specifies if the barrier will be dismissed when the user taps on it.

If true, and on_dismiss is non-None, on_dismiss will be called, otherwise the current route will be popped from the ambient Navigator.

If false, tapping on the barrier has no effect.

§on_dismiss: Option<Listener>

Called when the barrier is being dismissed.

If non-None, on_dismiss will be called in place of popping the current route. It is up to the callback to handle dismissing the barrier.

If None, the ambient Navigator’s current route will be popped.

This field is ignored if dismissible is false.

§barrier_semantics_dismissible: Option<bool>

Whether the modal barrier semantics are included in the semantics tree.

§semantics_label: Option<String>

Semantics label used for the barrier if it is dismissible.

The semantics label is read out by accessibility tools when the barrier is focused.

§clip_details_notifier: Option<Ref<ValueNotifier<EdgeInsets>>>

Contains a value of type EdgeInsets that specifies how the semantics node rectangle of the widget should be clipped.

§semantics_on_tap_hint: Option<String>

This hint text instructs users what they are able to do when they tap on the ModalBarrier.

Implementations§

Source§

impl ModalBarrier

Source

pub fn new() -> ModalBarrier

Creates a widget that blocks user interaction; Dart’s optional arguments are the setters.

Dart’s defaults: dismissible true, barrier_semantics_dismissible true.

Source

pub fn key(self, key: KeyRef) -> ModalBarrier

Dart ModalBarrier(key:).

Source

pub fn color(self, color: Color) -> ModalBarrier

Dart ModalBarrier(color:).

Source

pub fn dismissible(self, dismissible: bool) -> ModalBarrier

Dart ModalBarrier(dismissible:).

Source

pub fn on_dismiss(self, on_dismiss: Listener) -> ModalBarrier

Dart ModalBarrier(onDismiss:).

Source

pub fn barrier_semantics_dismissible( self, barrier_semantics_dismissible: bool, ) -> ModalBarrier

Dart ModalBarrier(barrierSemanticsDismissible:).

Source

pub fn maybe_barrier_semantics_dismissible( self, barrier_semantics_dismissible: Option<bool>, ) -> ModalBarrier

barrier_semantics_dismissible, for a caller that already holds the Option Dart’s named argument carries.

Source

pub fn semantics_label(self, semantics_label: String) -> ModalBarrier

Dart ModalBarrier(semanticsLabel:).

Source

pub fn maybe_semantics_label( self, semantics_label: Option<String>, ) -> ModalBarrier

semantics_label, for a caller that already holds the Option Dart’s named argument carries.

Source

pub fn clip_details_notifier( self, clip_details_notifier: Ref<ValueNotifier<EdgeInsets>>, ) -> ModalBarrier

Dart ModalBarrier(clipDetailsNotifier:).

Source

pub fn semantics_on_tap_hint( self, semantics_on_tap_hint: String, ) -> ModalBarrier

Dart ModalBarrier(semanticsOnTapHint:).

Trait Implementations§

Source§

impl Debug for ModalBarrier

Source§

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

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

impl Default for ModalBarrier

Source§

fn default() -> ModalBarrier

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

impl StatelessWidget for ModalBarrier

Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn build(&self, app: &mut App, context: BuildContext) -> WidgetRef

Describes the part of the user interface represented by this widget. Read more
Source§

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.
Source§

fn debug_check_constructor(&self)

Dart’s constructor asserts that relate two or more arguments. Read more
Source§

fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>

Dart’s 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 ModalBarrier

§

impl !Send for ModalBarrier

§

impl !Sync for ModalBarrier

§

impl !UnwindSafe for ModalBarrier

§

impl Forget for ModalBarrier

§

impl Freeze for ModalBarrier
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const RcInner<dyn Fn(&mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze, NonZero<u32>: Freeze, *const (): Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<fn() -> ValueNotifier<EdgeInsets>>: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze,

§

impl Move for ModalBarrier

§

impl Unpin for ModalBarrier
where Rc<dyn Key>: Unpin, Rc<dyn Fn(&mut App)>: Unpin, NonZero<u32>: Unpin, *const (): Unpin, *const u8 is !null: Unpin, Rc<Keep>: Unpin,

§

impl UnsafeUnpin for ModalBarrier
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, *const (): UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<fn() -> ValueNotifier<EdgeInsets>>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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<W> IntoWidget<StatelessKind> for W
where W: StatelessWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>