maybeOf static method

ThemeData maybeOf(
  1. BuildContext context
)

Retrieves the nearest ThemeData, or null if none is found.

Implementation

static ThemeData maybeOf(BuildContext context) {
  final widget = context.dependOnInheritedWidgetOfExactType<Theme>();
  return widget?.data ?? ThemeData.dark;
}