of static method

Access the FluffyThemeData from the nearest FluffyTheme ancestor.

Implementation

static FluffyThemeData of(BuildContext context) {
  if (maybeOf(context) case final theme?) return theme;

  throw FlutterError(
    'FluffyTheme.of() called with a context that does not contain a '
    'FluffyTheme. Wrap the application or screen in FluffyTheme before '
    'using sofluffy_ui components. Use FluffyThemeData.fallback() as the '
    'provider data when default styling is intended.',
  );
}