isThemeDark property

bool get isThemeDark

Check if the device is in dark mode

Implementation

bool get isThemeDark {
  if (isDeviceInDarkMode) return true;
  ThemeController themeController = ThemeProvider.controllerOf(this);
  if ((themeController.theme.options as NyThemeOptions).meta is Map &&
      (themeController.theme.options as NyThemeOptions).meta['type'] ==
          NyThemeType.dark) {
    return true;
  }

  return ThemeProvider.controllerOf(this).currentThemeId ==
      getEnv('DARK_THEME_ID');
}