of static method

Theme of(
  1. BuildContext context
)

Retrieves the Theme from the nearest WaveApp ancestor.

This function is used to access the theme data from any widget within the widget tree. It ensures that the theme is properly inherited and available to all components that need it.

Example:

final theme = Theme.of(context);

Implementation

static Theme of(BuildContext context) {
  final WaveApp? app = context.dependOnInheritedWidgetOfExactType<WaveApp>();
  assert(app != null, 'No WaveApp found in context');
  return app!.theme;
}