switchLightTheme method

void switchLightTheme(
  1. VDefaultThemeProps? themeData
)

Implementation

void switchLightTheme(VDefaultThemeProps? themeData) {
  if (null == themeData) {
    defaultColorScheme = VDefaultThemeProps(
      active: VColors.defaultActive,
      activeHover: VColors.defaultActiveHover,
      activePressed: VColors.defaultActivePressed,
      subtle: VColors.defaultSubtle,
      activeSubtle: VColors.defaultActiveSubtle,
      surface1: VColors.defaultSurface1,
      surface2: VColors.defaultSurface2,
      surface3: VColors.defaultSurface3,
      surfaceHighlight: VColors.defaultSurfaceHighlight,
      surfaceLowlight: VColors.defaultSurfaceLowlight,
      text: VColors.defaultText,
      textSubtle: VColors.defaultTextSubtle,
      onActive: VColors.defaultOnActive,
      border: VColors.defaultBorder,
      disabled: VColors.defaultDisabled,
      accent: VColors.defaultAccent,
      overlay: VColors.defaultOverlay,
      transparent: VColors.transparent,
      vAccordionProperties: VAccordionProperties(
        headerTextStyle: defaultVTheme.textStyles
            .bodyText2Medium, // @TODO unused; remove on major release
        bodyTextStyle: defaultVTheme
            .textStyles.subtitle2, // @TODO unused; remove on major release
        headerBoldTextStyle: defaultVTheme.textStyles.bodyText2Medium,
        headerSubtleTextStyle: defaultVTheme.textStyles.subtitle2,
      ),
      vAppBarProperties: VAppBarProperties(
        titleTextStyle:
            defaultVTheme.textStyles.headline4.copyWith(height: 1.3181),
      ),
      vBannerProperties: VBannerProperties(
        titleTextStyle: defaultVTheme.textStyles.bodyText2
            .copyWith(height: 1.5, fontWeight: VFontWeight.semiBold),
        descriptionTextStyle:
            defaultVTheme.textStyles.bodyText2.copyWith(height: 1.5),
      ),
      vButtonProperties: VButtonProperties(),
      vChipsRemovableProperties: VChipsRemovableProperties(
        chipLabelTextStyle: defaultVTheme.textStyles.uiLabelLarge,
      ),
      vChipsSelectionProperties: VChipsSelectionProperties(
        chipLabelTextStyle: defaultVTheme.textStyles.uiLabelLarge,
      ),
      vComboboxProperties: VComboboxProperties(
        errorTextStyle: defaultVTheme.textStyles.uiLabelLarge,
        resultTextStyle: defaultVTheme.textStyles.uiLabelLarge,
      ),
      vContentCardProperties: VContentCardProperties(),
      vDividerProperties: VDividerProperties(),
      vDropdownIconProperties: VDropdownIconProperties(
        dropdownTextStyle: defaultVTheme.textStyles.baseTextStyle,
      ),
      vDropdownTextProperties: VDropdownTextProperties(
        dropdownTextStyle: defaultVTheme.textStyles.baseTextStyle,
        bigIconTextStyle: defaultVTheme.textStyles.buttonLarge,
        smallIconTextStyle: defaultVTheme.textStyles.buttonMedium,
      ),
      vFlagProperties: VFlagProperties(
        linkTextStyle: defaultVTheme.textStyles.bodyText2Medium,
        titleTextStyle: defaultVTheme.textStyles.bodyText2,
        descriptionTextStyle: defaultVTheme.textStyles.bodyText2,
        closeIconPadding: const EdgeInsets.all(14),
      ),
      vInputProperties: VInputProperties(
        topLabelTextStyle: defaultVTheme.textStyles.uiLabelSmall,
        inputTextStyle: defaultVTheme.textStyles.bodyText2,
        errorTextStyle: defaultVTheme.textStyles.baseTextStyle,
        counterTextStyle: defaultVTheme.textStyles.baseTextStyle,
        validateErrorTextStyle: defaultVTheme.textStyles.uiLabelSmall,
        hintTextStyle: defaultVTheme.textStyles.bodyText2,
      ),
      vLinkProperties: VLinkProperties(
        titleTextStyle: defaultVTheme.textStyles.bodyText2Medium,
      ),
      vListItemProperties: VListItemProperties(),
      vNavDrawerProperties: VNavDrawerProperties(
        selectedLabelStyle: defaultVTheme.textStyles.uiLabelLargeActive,
        unselectedLabelStyle: defaultVTheme.textStyles.uiLabelLarge
            .copyWith(color: VColors.defaultTextSubtle),
      ),
      vPanelProperties: VPanelProperties(
        titleTextStyle: defaultVTheme.textStyles.headline3,
      ),
      vProgressProperties: VProgressProperties(
        circularLabelTextStyle: defaultVTheme.textStyles.uiLabelActive,
      ),
      vSelectProperties: VSelectProperties(
        headerTextStyle: defaultVTheme.textStyles.uiLabel,
        labelTextStyle: defaultVTheme.textStyles.baseTextStyle,
        validateTextStyle: defaultVTheme.textStyles.bodyText3,
      ),
      vTabBarProperties: VTabBarProperties(
        labelStyle: defaultVTheme.textStyles.uiLabelLargeActive,
        unselectedLabelStyle: defaultVTheme.textStyles.uiLabelLarge,
      ),
      vToggleProperties: VToggleProperties(),
      vWizardProperties: VWizardProperties(
        numberTextStyle: defaultVTheme.textStyles.uiLabelActive.copyWith(
          color: VColors.defaultSurface1,
          fontWeight: VFontWeight.medium,
        ),
      ),
    );
  } else {
    defaultColorScheme = defaultColorScheme.copyWith(
      active: themeData.active,
      activeHover: themeData.activeHover,
      activePressed: themeData.activePressed,
      subtle: themeData.subtle,
      activeSubtle: themeData.activeSubtle,
      surface1: themeData.surface1,
      surface2: themeData.surface2,
      surface3: themeData.surface3,
      surfaceHighlight: themeData.surfaceHighlight,
      surfaceLowlight: themeData.surfaceLowlight,
      text: themeData.text,
      textSubtle: themeData.textSubtle,
      onActive: themeData.onActive,
      border: themeData.border,
      disabled: themeData.disabled,
      accent: themeData.accent,
      overlay: themeData.overlay,
      transparent: themeData.transparent,
      vAccordionProperties: themeData.vAccordionProperties,
      vAppBarProperties: themeData.vAppBarProperties,
      vAvatarProperties: themeData.vAvatarProperties,
      vBannerProperties: themeData.vBannerProperties,
      vBottomNavBarProperties: themeData.vBottomNavBarProperties,
      vButtonProperties: themeData.vButtonProperties,
      vChipsRemovableProperties: themeData.vChipsRemovableProperties,
      vChipsSelectionProperties: themeData.vChipsSelectionProperties,
      vComboboxProperties: themeData.vComboboxProperties,
      vContentCardProperties: themeData.vContentCardProperties,
      vDividerProperties: themeData.vDividerProperties,
      vDropdownIconProperties: themeData.vDropdownIconProperties,
      vDropdownTextProperties: themeData.vDropdownTextProperties,
      vFlagProperties: themeData.vFlagProperties,
      vInputProperties: themeData.vInputProperties,
      vLinkProperties: themeData.vLinkProperties,
      vListItemProperties: themeData.vListItemProperties,
      vNavDrawerProperties: themeData.vNavDrawerProperties,
      vPanelProperties: themeData.vPanelProperties,
      vProgressProperties: themeData.vProgressProperties,
      vSelectProperties: themeData.vSelectProperties,
      vTabBarProperties: themeData.vTabBarProperties,
      vToggleProperties: themeData.vToggleProperties,
      vWizardProperties: themeData.vWizardProperties,
    ) as VDefaultThemeProps;
  }
}