valuesOf static method
- BuildContext context
Returns the requested ticker mode values for this subtree and establishes a dependency on the ancestor TickerMode, if any.
This is used automatically by TickerProviderStateMixin and SingleTickerProviderStateMixin to decide if their tickers should be enabled or disabled.
In the absence of a TickerMode widget, this defaults to enabled tickers that don't force frames.
Typical usage is as follows:
bool tickingEnabled = TickerMode.valuesOf(context).enabled;
Implementation
static TickerModeData valuesOf(BuildContext context) {
final _EffectiveTickerMode? widget = context
.dependOnInheritedWidgetOfExactType<_EffectiveTickerMode>();
return widget?.values ?? TickerModeData.fallback;
}