Skip to main content

SnapshotController

Struct SnapshotController 

Source
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

Source

pub fn new(app: &mut App, allow_snapshotting: bool) -> Ref<SnapshotController>

Create a new SnapshotController.

By default, allow_snapshotting is false: Dart’s SnapshotController({bool allowSnapshotting = false}).

Source

pub fn clear(self: Handle<Self>, app: &mut App)

Reset the snapshot held by any listening SnapshotWidget.

This has no effect if allow_snapshotting is false.

Source

pub fn allow_snapshotting(self: Handle<Self>, app: &App) -> bool

Whether a snapshot of this child widget is painted in its place.

Source

pub fn set_allow_snapshotting(self: Handle<Self>, app: &mut App, value: bool)

Source

pub fn dispose(self: Handle<Self>, app: &mut App)

Discards any resources used by the object. Dart’s inherited ChangeNotifier.dispose.

Trait Implementations§

Source§

impl ChangeNotifier for SnapshotController

Source§

fn change_notifier_data(&self) -> &ChangeNotifierData

Source§

fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData

Source§

fn will_add_listener(self: Handle<Self>, app: &mut App)

Runs before the listener is stored. Dart overrides of addListener that work before super.addListener go here.
Source§

fn did_remove_listener(self: Handle<Self>, app: &mut App)

Runs after the listener is removed. Dart overrides of removeListener that work after super.removeListener go here.
Source§

impl Debug for SnapshotController

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> ListenableObject for T
where T: ChangeNotifier,

Source§

fn add_listener(self: Handle<T>, app: &mut App, listener: Listener)

Register a closure to be called when the object notifies its listeners.
Source§

fn remove_listener(self: Handle<T>, app: &mut App, listener: &Listener)

Remove a previously registered closure from the list of closures that the object notifies.
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>