of static method

ScannerTheme of(
  1. BuildContext context
)

The theme of the nearest ScannerScope, or the default theme; without a brightness, the platform's (light where unknown).

Implementation

static ScannerTheme of(BuildContext context) {
  final ScannerTheme theme =
      context.dependOnInheritedWidgetOfExactType<ScannerScope>()?.theme ??
      const ScannerTheme();
  return theme.brightness != null
      ? theme
      : theme.copyWith(
          brightness:
              MediaQuery.maybePlatformBrightnessOf(context) ??
              Brightness.light,
        );
}