toThemeMode method

ThemeMode toThemeMode()

Returns the ThemeMode matching this name, or ThemeMode.system when unknown or null.

Implementation

ThemeMode toThemeMode() => ThemeMode.values.firstWhere(
  (theme) => theme.name == this,
  orElse: () => ThemeMode.system,
);