pub struct TickerModeData {
pub enabled: bool,
pub force_frames: bool,
}Expand description
Immutable compound values that describe the effective ticker behavior for a subtree.
Instances of this class are produced by TickerMode::values_of and
TickerMode::get_values_notifier and reflect the values that apply at a given
location in the widget tree after taking ancestor TickerMode widgets into
account.
Semantics of the fields:
enabled: A ticker is considered enabled only if all ancestorTickerMode::enabledvalues and the localTickerMode::enabledare true (logical AND). When false, tickers are muted (time still elapses but callbacks are not invoked).force_frames: When true, tickers in the subtree request frames usingSchedulerBinding::schedule_forced_framewhile active. This value is combined across ancestors using logical OR, so any ancestor requesting forced frames enables it for the subtree.
For most widgets, reading these values is unnecessary; mixins such as
SingleTickerProviderStateMixin and TickerProviderStateMixin apply them
automatically to the Tickers they vend. Use this class when you need to
observe or react to ticker policy explicitly.
Fields§
§enabled: boolWhether tickers are enabled (not muted) for the subtree.
Effective value is the logical AND of all ancestor and local
TickerMode::enabled values.
force_frames: boolWhether tickers should request forced frames while active.
Effective value is the logical OR of all ancestor and local
TickerMode::force_frames values. Forcing frames may increase battery
usage, so use sparingly.
Implementations§
Source§impl TickerModeData
impl TickerModeData
Sourcepub const FALLBACK: TickerModeData
pub const FALLBACK: TickerModeData
Fallback values used when there is no ancestor TickerMode.
This corresponds to tickers being enabled and not forcing frames.
Trait Implementations§
Source§impl Clone for TickerModeData
impl Clone for TickerModeData
impl Copy for TickerModeData
Source§impl Debug for TickerModeData
impl Debug for TickerModeData
impl Eq for TickerModeData
Source§impl Hash for TickerModeData
impl Hash for TickerModeData
Source§impl PartialEq for TickerModeData
impl PartialEq for TickerModeData
impl StructuralPartialEq for TickerModeData
Auto Trait Implementations§
impl Forget for TickerModeData
impl Freeze for TickerModeData
impl Move for TickerModeData
impl RefUnwindSafe for TickerModeData
impl Send for TickerModeData
impl Sync for TickerModeData
impl Unpin for TickerModeData
impl UnsafeUnpin for TickerModeData
impl UnwindSafe for TickerModeData
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.