pub struct SnapshotController { /* private fields */ }Expand description
A controller for the SnapshotWidget that controls when the child image is displayed
and when to regenerated the child image.
When the value of allow_snapshotting is true, the
SnapshotWidget will paint the child widgets based on the SnapshotMode of the
snapshot widget.
The controller notifies its listeners when the value of
allow_snapshotting changes or when clear is
called.
To force SnapshotWidget to recreate the child image, call clear.
Implementations§
Source§impl SnapshotController
impl SnapshotController
Sourcepub fn new(
app: &mut App,
allow_snapshotting: bool,
) -> Retained<Handle<SnapshotController>>
pub fn new( app: &mut App, allow_snapshotting: bool, ) -> Retained<Handle<SnapshotController>>
Create a new SnapshotController.
By default, allow_snapshotting is false: Dart’s
SnapshotController({bool allowSnapshotting = false}).
Sourcepub fn clear(self: Handle<SnapshotController>, app: &mut App)
pub fn clear(self: Handle<SnapshotController>, app: &mut App)
Reset the snapshot held by any listening SnapshotWidget.
This has no effect if allow_snapshotting is false.
Sourcepub fn allow_snapshotting(self: Handle<SnapshotController>, app: &App) -> bool
pub fn allow_snapshotting(self: Handle<SnapshotController>, app: &App) -> bool
Whether a snapshot of this child widget is painted in its place.
Sourcepub fn set_allow_snapshotting(
self: Handle<SnapshotController>,
app: &mut App,
value: bool,
)
pub fn set_allow_snapshotting( self: Handle<SnapshotController>, app: &mut App, value: bool, )
Sets allow_snapshotting.
Sourcepub fn dispose(self: Handle<SnapshotController>, app: &mut App)
pub fn dispose(self: Handle<SnapshotController>, app: &mut App)
Discards any resources used by the object. Dart’s inherited ChangeNotifier.dispose.
Trait Implementations§
Source§impl ChangeNotifier for SnapshotController
impl ChangeNotifier for SnapshotController
fn change_notifier_data(&self) -> &ChangeNotifierData
fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData
Source§fn will_add_listener(self: Handle<Self>, app: &mut App)
fn will_add_listener(self: Handle<Self>, app: &mut App)
addListener that
work before super.addListener go here.Source§fn did_remove_listener(self: Handle<Self>, app: &mut App)
fn did_remove_listener(self: Handle<Self>, app: &mut App)
removeListener that
work after super.removeListener go here.Auto Trait Implementations§
impl !RefUnwindSafe for SnapshotController
impl !Send for SnapshotController
impl !Sync for SnapshotController
impl !UnwindSafe for SnapshotController
impl Forget for SnapshotController
impl Freeze for SnapshotController
impl Move for SnapshotController
impl Unpin for SnapshotController
impl UnsafeUnpin for SnapshotControllerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Option<Listener>>: UnsafeUnpin,
*const RcInner<Cell<usize>> is !null: UnsafeUnpin,
PhantomData<RcInner<Cell<usize>>>: 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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.