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:
ModalRoute, which indirectly uses this widget.AnimatedModalBarrier, which is similar but takes an animatedcolorinstead of a single color value.
Fields§
§key: Option<KeyRef>§color: Option<Color>If non-None, fill the barrier with this color.
dismissible: boolSpecifies 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
impl ModalBarrier
Sourcepub fn new() -> ModalBarrier
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.
Sourcepub fn key(self, key: KeyRef) -> ModalBarrier
pub fn key(self, key: KeyRef) -> ModalBarrier
Dart ModalBarrier(key:).
Sourcepub fn color(self, color: Color) -> ModalBarrier
pub fn color(self, color: Color) -> ModalBarrier
Dart ModalBarrier(color:).
Sourcepub fn dismissible(self, dismissible: bool) -> ModalBarrier
pub fn dismissible(self, dismissible: bool) -> ModalBarrier
Dart ModalBarrier(dismissible:).
Sourcepub fn on_dismiss(self, on_dismiss: Listener) -> ModalBarrier
pub fn on_dismiss(self, on_dismiss: Listener) -> ModalBarrier
Dart ModalBarrier(onDismiss:).
Sourcepub fn barrier_semantics_dismissible(
self,
barrier_semantics_dismissible: bool,
) -> ModalBarrier
pub fn barrier_semantics_dismissible( self, barrier_semantics_dismissible: bool, ) -> ModalBarrier
Dart ModalBarrier(barrierSemanticsDismissible:).
Sourcepub fn maybe_barrier_semantics_dismissible(
self,
barrier_semantics_dismissible: Option<bool>,
) -> ModalBarrier
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.
Sourcepub fn semantics_label(self, semantics_label: String) -> ModalBarrier
pub fn semantics_label(self, semantics_label: String) -> ModalBarrier
Dart ModalBarrier(semanticsLabel:).
Sourcepub fn maybe_semantics_label(
self,
semantics_label: Option<String>,
) -> ModalBarrier
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.
Sourcepub fn clip_details_notifier(
self,
clip_details_notifier: Ref<ValueNotifier<EdgeInsets>>,
) -> ModalBarrier
pub fn clip_details_notifier( self, clip_details_notifier: Ref<ValueNotifier<EdgeInsets>>, ) -> ModalBarrier
Dart ModalBarrier(clipDetailsNotifier:).
Sourcepub fn semantics_on_tap_hint(
self,
semantics_on_tap_hint: String,
) -> ModalBarrier
pub fn semantics_on_tap_hint( self, semantics_on_tap_hint: String, ) -> ModalBarrier
Dart ModalBarrier(semanticsOnTapHint:).
Trait Implementations§
Source§impl Debug for ModalBarrier
impl Debug for ModalBarrier
Source§impl Default for ModalBarrier
impl Default for ModalBarrier
Source§fn default() -> ModalBarrier
fn default() -> ModalBarrier
Source§impl StatelessWidget for ModalBarrier
impl StatelessWidget for ModalBarrier
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>
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 ModalBarrier
impl !Send for ModalBarrier
impl !Sync for ModalBarrier
impl !UnwindSafe for ModalBarrier
impl Forget for ModalBarrier
impl Freeze for ModalBarrierwhere
*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
impl UnsafeUnpin for ModalBarrierwhere
*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> 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.