Skip to main content

ScaffoldFeatureController

Struct ScaffoldFeatureController 

Source
pub struct ScaffoldFeatureController<T, U> {
    pub close: VoidCallback,
    pub set_state: Option<StateSetter>,
    /* private fields */
}
Expand description

An interface for controlling a feature of a Scaffold.

Commonly obtained from ScaffoldMessengerState::show_snack_bar or ScaffoldState::show_bottom_sheet.

Dart compares controllers by identity; here they are shared as Rcs and compared with Rc::ptr_eq.

Fields§

§close: VoidCallback

Remove the feature (e.g., bottom sheet, snack bar, or material banner) from the scaffold.

§set_state: Option<StateSetter>

Mark the feature (e.g., bottom sheet or snack bar) as needing to rebuild.

Implementations§

Source§

impl<T: 'static, U: Clone + 'static> ScaffoldFeatureController<T, U>

Source

pub fn closed(&self) -> CompleterFuture<U> ⓘ

Completes when the feature controlled by this object is no longer visible.

Trait Implementations§

Source§

impl<T, U> Debug for ScaffoldFeatureController<T, U>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, U> !RefUnwindSafe for ScaffoldFeatureController<T, U>

§

impl<T, U> !Send for ScaffoldFeatureController<T, U>

§

impl<T, U> !Sync for ScaffoldFeatureController<T, U>

§

impl<T, U> !UnwindSafe for ScaffoldFeatureController<T, U>

§

impl<T, U> Forget for ScaffoldFeatureController<T, U>

§

impl<T, U> Freeze for ScaffoldFeatureController<T, U>
where *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze, *const RcInner<Shared<U>> is !null: Freeze, PhantomData<RcInner<Shared<U>>>: Freeze, *const RcInner<dyn Fn(&mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze, *const RcInner<dyn Fn(&mut App, &mut dyn FnMut(&mut App))> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, &mut dyn FnMut(&mut App))>>: Freeze, PhantomData<T>: Freeze,

§

impl<T, U> Move for ScaffoldFeatureController<T, U>

§

impl<T, U> Unpin for ScaffoldFeatureController<T, U>
where T: Unpin, Rc<dyn Widget>: Unpin, Rc<Shared<U>>: Unpin, Rc<dyn Fn(&mut App)>: Unpin, Rc<dyn Fn(&mut App, &mut dyn FnMut(&mut App))>: Unpin,

§

impl<T, U> UnsafeUnpin for ScaffoldFeatureController<T, U>
where *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, *const RcInner<Shared<U>> is !null: UnsafeUnpin, PhantomData<RcInner<Shared<U>>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, &mut dyn FnMut(&mut App))> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, &mut dyn FnMut(&mut App))>>: UnsafeUnpin, PhantomData<T>: 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<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>