of static method

The tokens for context: the theme's extension, with every missing token filled from its color scheme.

Implementation

static VyuhThemeExtension of(BuildContext context) {
  final theme = Theme.of(context);
  final fallback = VyuhThemeExtension.fallback(theme.colorScheme);
  final custom = theme.extension<VyuhThemeExtension>();
  return custom == null ? fallback : fallback._merge(custom);
}