modeOf static method

ThemeMode? modeOf(
  1. BuildContext context
)

Retrieves the ThemeMode from the widget tree. This allows access to the current theme mode (light or dark).. context The BuildContext from which to retrieve the theme. returns The ThemeMode associated with the current context.

Implementation

static ThemeMode? modeOf(BuildContext context) {
  return InheritedModel.inheritFrom<OudsTheme>(context, aspect: OudsThemeAspect.themeMode)?.themeMode;
}