bool of(BuildContext context)

Whether tickers in the given subtree should be enabled or disabled.

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 function defaults to true.

Typical usage is as follows:

bool tickingEnabled = TickerMode.of(context);

Source

static bool of(BuildContext context) {
  TickerMode widget = context.inheritFromWidgetOfExactType(TickerMode);
  return widget?.enabled ?? true;
}