of static method

The theme registered in context, or the package defaults.

Never returns null, so widgets do not need a fallback of their own.

Implementation

static PerformanceTheme of(BuildContext context) {
  return Theme.of(context).extension<PerformanceTheme>() ??
      const PerformanceTheme();
}