merge method

SACThemeConfig merge(
  1. SACThemeConfig? other
)

Merges this config with another, giving priority to the other config's non-null values

Implementation

SACThemeConfig merge(SACThemeConfig? other) {
  if (other == null) return this;
  return SACThemeConfig(
    primary: other.primary ?? primary,
    primaryLight: other.primaryLight ?? primaryLight,
    primaryDark: other.primaryDark ?? primaryDark,
    secondary: other.secondary ?? secondary,
    secondaryLight: other.secondaryLight ?? secondaryLight,
    secondaryDark: other.secondaryDark ?? secondaryDark,
    error: other.error ?? error,
    errorLight: other.errorLight ?? errorLight,
    errorDark: other.errorDark ?? errorDark,
    success: other.success ?? success,
    successLight: other.successLight ?? successLight,
    successDark: other.successDark ?? successDark,
    backgroundLight: other.backgroundLight ?? backgroundLight,
    surfaceLight: other.surfaceLight ?? surfaceLight,
    borderLight: other.borderLight ?? borderLight,
    textPrimaryLight: other.textPrimaryLight ?? textPrimaryLight,
    textMutedLight: other.textMutedLight ?? textMutedLight,
    backgroundDark: other.backgroundDark ?? backgroundDark,
    surfaceDark: other.surfaceDark ?? surfaceDark,
    borderDark: other.borderDark ?? borderDark,
    textPrimaryDark: other.textPrimaryDark ?? textPrimaryDark,
    textMutedDark: other.textMutedDark ?? textMutedDark,
    lightRed: other.lightRed ?? lightRed,
    purple: other.purple ?? purple,
    grey: other.grey ?? grey,
    darkGrey: other.darkGrey ?? darkGrey,
    scaffoldBackgroundLight:
        other.scaffoldBackgroundLight ?? scaffoldBackgroundLight,
    scaffoldBackgroundDark:
        other.scaffoldBackgroundDark ?? scaffoldBackgroundDark,
    appBarBackgroundLight:
        other.appBarBackgroundLight ?? appBarBackgroundLight,
    appBarBackgroundDark: other.appBarBackgroundDark ?? appBarBackgroundDark,
    appBarForegroundLight:
        other.appBarForegroundLight ?? appBarForegroundLight,
    appBarForegroundDark: other.appBarForegroundDark ?? appBarForegroundDark,
    appBarElevation: other.appBarElevation ?? appBarElevation,
    appBarCenterTitle: other.appBarCenterTitle ?? appBarCenterTitle,
    appBarTitleTextStyle: other.appBarTitleTextStyle ?? appBarTitleTextStyle,
    appBarIconTheme: other.appBarIconTheme ?? appBarIconTheme,
    bottomNavBackgroundLight:
        other.bottomNavBackgroundLight ?? bottomNavBackgroundLight,
    bottomNavBackgroundDark:
        other.bottomNavBackgroundDark ?? bottomNavBackgroundDark,
    bottomNavSelectedColor:
        other.bottomNavSelectedColor ?? bottomNavSelectedColor,
    bottomNavUnselectedColor:
        other.bottomNavUnselectedColor ?? bottomNavUnselectedColor,
    bottomNavElevation: other.bottomNavElevation ?? bottomNavElevation,
    bottomNavType: other.bottomNavType ?? bottomNavType,
    navigationBarBackgroundLight:
        other.navigationBarBackgroundLight ?? navigationBarBackgroundLight,
    navigationBarBackgroundDark:
        other.navigationBarBackgroundDark ?? navigationBarBackgroundDark,
    navigationBarIndicatorColor:
        other.navigationBarIndicatorColor ?? navigationBarIndicatorColor,
    navigationBarHeight: other.navigationBarHeight ?? navigationBarHeight,
    navigationRailBackgroundLight:
        other.navigationRailBackgroundLight ?? navigationRailBackgroundLight,
    navigationRailBackgroundDark:
        other.navigationRailBackgroundDark ?? navigationRailBackgroundDark,
    navigationRailSelectedColor:
        other.navigationRailSelectedColor ?? navigationRailSelectedColor,
    navigationRailUnselectedColor:
        other.navigationRailUnselectedColor ?? navigationRailUnselectedColor,
    drawerBackgroundLight:
        other.drawerBackgroundLight ?? drawerBackgroundLight,
    drawerBackgroundDark: other.drawerBackgroundDark ?? drawerBackgroundDark,
    drawerWidth: other.drawerWidth ?? drawerWidth,
    drawerElevation: other.drawerElevation ?? drawerElevation,
    fabBackgroundLight: other.fabBackgroundLight ?? fabBackgroundLight,
    fabBackgroundDark: other.fabBackgroundDark ?? fabBackgroundDark,
    fabForegroundLight: other.fabForegroundLight ?? fabForegroundLight,
    fabForegroundDark: other.fabForegroundDark ?? fabForegroundDark,
    fabElevation: other.fabElevation ?? fabElevation,
    fabShape: other.fabShape ?? fabShape,
    elevatedButtonStyle: other.elevatedButtonStyle ?? elevatedButtonStyle,
    outlinedButtonStyle: other.outlinedButtonStyle ?? outlinedButtonStyle,
    textButtonStyle: other.textButtonStyle ?? textButtonStyle,
    filledButtonStyle: other.filledButtonStyle ?? filledButtonStyle,
    iconButtonStyle: other.iconButtonStyle ?? iconButtonStyle,
    cardColorLight: other.cardColorLight ?? cardColorLight,
    cardColorDark: other.cardColorDark ?? cardColorDark,
    cardElevation: other.cardElevation ?? cardElevation,
    cardShape: other.cardShape ?? cardShape,
    cardMargin: other.cardMargin ?? cardMargin,
    dialogBackgroundLight:
        other.dialogBackgroundLight ?? dialogBackgroundLight,
    dialogBackgroundDark: other.dialogBackgroundDark ?? dialogBackgroundDark,
    dialogElevation: other.dialogElevation ?? dialogElevation,
    dialogShape: other.dialogShape ?? dialogShape,
    dialogTitleStyle: other.dialogTitleStyle ?? dialogTitleStyle,
    dialogContentStyle: other.dialogContentStyle ?? dialogContentStyle,
    bottomSheetBackgroundLight:
        other.bottomSheetBackgroundLight ?? bottomSheetBackgroundLight,
    bottomSheetBackgroundDark:
        other.bottomSheetBackgroundDark ?? bottomSheetBackgroundDark,
    bottomSheetElevation: other.bottomSheetElevation ?? bottomSheetElevation,
    bottomSheetShape: other.bottomSheetShape ?? bottomSheetShape,
    bottomSheetDragHandleColor:
        other.bottomSheetDragHandleColor ?? bottomSheetDragHandleColor,
    snackBarBackgroundLight:
        other.snackBarBackgroundLight ?? snackBarBackgroundLight,
    snackBarBackgroundDark:
        other.snackBarBackgroundDark ?? snackBarBackgroundDark,
    snackBarActionColor: other.snackBarActionColor ?? snackBarActionColor,
    snackBarBehavior: other.snackBarBehavior ?? snackBarBehavior,
    inputFillColorLight: other.inputFillColorLight ?? inputFillColorLight,
    inputFillColorDark: other.inputFillColorDark ?? inputFillColorDark,
    inputBorderColor: other.inputBorderColor ?? inputBorderColor,
    inputFocusedBorderColor:
        other.inputFocusedBorderColor ?? inputFocusedBorderColor,
    inputErrorBorderColor:
        other.inputErrorBorderColor ?? inputErrorBorderColor,
    inputLabelStyle: other.inputLabelStyle ?? inputLabelStyle,
    inputHintStyle: other.inputHintStyle ?? inputHintStyle,
    inputBorderRadius: other.inputBorderRadius ?? inputBorderRadius,
    checkboxFillColor: other.checkboxFillColor ?? checkboxFillColor,
    radioFillColor: other.radioFillColor ?? radioFillColor,
    switchActiveColor: other.switchActiveColor ?? switchActiveColor,
    switchInactiveColor: other.switchInactiveColor ?? switchInactiveColor,
    switchTrackColor: other.switchTrackColor ?? switchTrackColor,
    sliderActiveColor: other.sliderActiveColor ?? sliderActiveColor,
    sliderInactiveColor: other.sliderInactiveColor ?? sliderInactiveColor,
    sliderThumbColor: other.sliderThumbColor ?? sliderThumbColor,
    progressIndicatorColor:
        other.progressIndicatorColor ?? progressIndicatorColor,
    progressIndicatorBackgroundColor:
        other.progressIndicatorBackgroundColor ??
        progressIndicatorBackgroundColor,
    circularProgressStrokeWidth:
        other.circularProgressStrokeWidth ?? circularProgressStrokeWidth,
    tooltipBackgroundColor:
        other.tooltipBackgroundColor ?? tooltipBackgroundColor,
    tooltipTextStyle: other.tooltipTextStyle ?? tooltipTextStyle,
    tooltipPadding: other.tooltipPadding ?? tooltipPadding,
    dividerColor: other.dividerColor ?? dividerColor,
    dividerThickness: other.dividerThickness ?? dividerThickness,
    dividerIndent: other.dividerIndent ?? dividerIndent,
    listTileIconColor: other.listTileIconColor ?? listTileIconColor,
    listTileTitleStyle: other.listTileTitleStyle ?? listTileTitleStyle,
    listTileSubtitleStyle:
        other.listTileSubtitleStyle ?? listTileSubtitleStyle,
    listTileSelectedColor:
        other.listTileSelectedColor ?? listTileSelectedColor,
    tabBarIndicatorColor: other.tabBarIndicatorColor ?? tabBarIndicatorColor,
    tabBarLabelColor: other.tabBarLabelColor ?? tabBarLabelColor,
    tabBarUnselectedLabelColor:
        other.tabBarUnselectedLabelColor ?? tabBarUnselectedLabelColor,
    tabBarIndicatorWeight:
        other.tabBarIndicatorWeight ?? tabBarIndicatorWeight,
    dataTableHeadingRowColor:
        other.dataTableHeadingRowColor ?? dataTableHeadingRowColor,
    dataTableDataRowColor:
        other.dataTableDataRowColor ?? dataTableDataRowColor,
    dataTableDividerThickness:
        other.dataTableDividerThickness ?? dataTableDividerThickness,
    chipBackgroundLight: other.chipBackgroundLight ?? chipBackgroundLight,
    chipBackgroundDark: other.chipBackgroundDark ?? chipBackgroundDark,
    chipLabelStyle: other.chipLabelStyle ?? chipLabelStyle,
    chipDeleteIconColor: other.chipDeleteIconColor ?? chipDeleteIconColor,
    chipSelectedColor: other.chipSelectedColor ?? chipSelectedColor,
    badgeBackgroundColor: other.badgeBackgroundColor ?? badgeBackgroundColor,
    badgeTextColor: other.badgeTextColor ?? badgeTextColor,
    searchBarBackgroundLight:
        other.searchBarBackgroundLight ?? searchBarBackgroundLight,
    searchBarBackgroundDark:
        other.searchBarBackgroundDark ?? searchBarBackgroundDark,
    searchBarElevation: other.searchBarElevation ?? searchBarElevation,
    searchBarHintStyle: other.searchBarHintStyle ?? searchBarHintStyle,
    segmentedButtonSelectedColor:
        other.segmentedButtonSelectedColor ?? segmentedButtonSelectedColor,
    segmentedButtonForegroundColor:
        other.segmentedButtonForegroundColor ??
        segmentedButtonForegroundColor,
    popupMenuBackgroundLight:
        other.popupMenuBackgroundLight ?? popupMenuBackgroundLight,
    popupMenuBackgroundDark:
        other.popupMenuBackgroundDark ?? popupMenuBackgroundDark,
    popupMenuElevation: other.popupMenuElevation ?? popupMenuElevation,
    popupMenuShape: other.popupMenuShape ?? popupMenuShape,
    expansionTileBackgroundColor:
        other.expansionTileBackgroundColor ?? expansionTileBackgroundColor,
    expansionTileCollapsedBackgroundColor:
        other.expansionTileCollapsedBackgroundColor ??
        expansionTileCollapsedBackgroundColor,
    expansionTileIconColor:
        other.expansionTileIconColor ?? expansionTileIconColor,
    fontFamily: other.fontFamily ?? fontFamily,
    displayLarge: other.displayLarge ?? displayLarge,
    displayMedium: other.displayMedium ?? displayMedium,
    displaySmall: other.displaySmall ?? displaySmall,
    headlineLarge: other.headlineLarge ?? headlineLarge,
    headlineMedium: other.headlineMedium ?? headlineMedium,
    headlineSmall: other.headlineSmall ?? headlineSmall,
    titleLarge: other.titleLarge ?? titleLarge,
    titleMedium: other.titleMedium ?? titleMedium,
    titleSmall: other.titleSmall ?? titleSmall,
    bodyLarge: other.bodyLarge ?? bodyLarge,
    bodyMedium: other.bodyMedium ?? bodyMedium,
    bodySmall: other.bodySmall ?? bodySmall,
    labelLarge: other.labelLarge ?? labelLarge,
    labelMedium: other.labelMedium ?? labelMedium,
    labelSmall: other.labelSmall ?? labelSmall,
    splashColor: other.splashColor ?? splashColor,
    highlightColor: other.highlightColor ?? highlightColor,
    hoverColor: other.hoverColor ?? hoverColor,
    focusColor: other.focusColor ?? focusColor,
    disabledColor: other.disabledColor ?? disabledColor,
    shadowColor: other.shadowColor ?? shadowColor,
    visualDensity: other.visualDensity ?? visualDensity,
    materialTapTargetSize:
        other.materialTapTargetSize ?? materialTapTargetSize,
  );
}