merge method
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,
elevatedButtonBackgroundColor:
other.elevatedButtonBackgroundColor ?? elevatedButtonBackgroundColor,
elevatedButtonBackgroundColorLight:
other.elevatedButtonBackgroundColorLight ??
elevatedButtonBackgroundColorLight,
elevatedButtonBackgroundColorDark:
other.elevatedButtonBackgroundColorDark ??
elevatedButtonBackgroundColorDark,
elevatedButtonForegroundColor:
other.elevatedButtonForegroundColor ?? elevatedButtonForegroundColor,
elevatedButtonForegroundColorLight:
other.elevatedButtonForegroundColorLight ??
elevatedButtonForegroundColorLight,
elevatedButtonForegroundColorDark:
other.elevatedButtonForegroundColorDark ??
elevatedButtonForegroundColorDark,
outlinedButtonStyle: other.outlinedButtonStyle ?? outlinedButtonStyle,
outlinedButtonTextColor:
other.outlinedButtonTextColor ?? outlinedButtonTextColor,
outlinedButtonTextColorLight:
other.outlinedButtonTextColorLight ?? outlinedButtonTextColorLight,
outlinedButtonTextColorDark:
other.outlinedButtonTextColorDark ?? outlinedButtonTextColorDark,
outlinedButtonBorderColor:
other.outlinedButtonBorderColor ?? outlinedButtonBorderColor,
outlinedButtonBorderColorLight:
other.outlinedButtonBorderColorLight ??
outlinedButtonBorderColorLight,
outlinedButtonBorderColorDark:
other.outlinedButtonBorderColorDark ?? outlinedButtonBorderColorDark,
textButtonStyle: other.textButtonStyle ?? textButtonStyle,
textButtonTextColor: other.textButtonTextColor ?? textButtonTextColor,
textButtonTextColorLight:
other.textButtonTextColorLight ?? textButtonTextColorLight,
textButtonTextColorDark:
other.textButtonTextColorDark ?? textButtonTextColorDark,
filledButtonStyle: other.filledButtonStyle ?? filledButtonStyle,
filledButtonBackgroundColor:
other.filledButtonBackgroundColor ?? filledButtonBackgroundColor,
filledButtonBackgroundColorLight:
other.filledButtonBackgroundColorLight ??
filledButtonBackgroundColorLight,
filledButtonBackgroundColorDark:
other.filledButtonBackgroundColorDark ??
filledButtonBackgroundColorDark,
filledButtonForegroundColor:
other.filledButtonForegroundColor ?? filledButtonForegroundColor,
filledButtonForegroundColorLight:
other.filledButtonForegroundColorLight ??
filledButtonForegroundColorLight,
filledButtonForegroundColorDark:
other.filledButtonForegroundColorDark ??
filledButtonForegroundColorDark,
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,
inputBorderColorLight:
other.inputBorderColorLight ?? inputBorderColorLight,
inputBorderColorDark: other.inputBorderColorDark ?? inputBorderColorDark,
inputFocusedBorderColor:
other.inputFocusedBorderColor ?? inputFocusedBorderColor,
inputFocusedBorderColorLight:
other.inputFocusedBorderColorLight ?? inputFocusedBorderColorLight,
inputFocusedBorderColorDark:
other.inputFocusedBorderColorDark ?? inputFocusedBorderColorDark,
inputErrorBorderColor:
other.inputErrorBorderColor ?? inputErrorBorderColor,
inputErrorBorderColorLight:
other.inputErrorBorderColorLight ?? inputErrorBorderColorLight,
inputErrorBorderColorDark:
other.inputErrorBorderColorDark ?? inputErrorBorderColorDark,
inputLabelStyle: other.inputLabelStyle ?? inputLabelStyle,
inputHintStyle: other.inputHintStyle ?? inputHintStyle,
inputBorderRadius: other.inputBorderRadius ?? inputBorderRadius,
inputHeight: other.inputHeight ?? inputHeight,
phoneFieldHeight: other.phoneFieldHeight ?? phoneFieldHeight,
dropdownHeight: other.dropdownHeight ?? dropdownHeight,
buttonHeight: other.buttonHeight ?? buttonHeight,
checkboxFillColor: other.checkboxFillColor ?? checkboxFillColor,
checkboxFillColorLight:
other.checkboxFillColorLight ?? checkboxFillColorLight,
checkboxFillColorDark:
other.checkboxFillColorDark ?? checkboxFillColorDark,
radioFillColor: other.radioFillColor ?? radioFillColor,
radioFillColorLight: other.radioFillColorLight ?? radioFillColorLight,
radioFillColorDark: other.radioFillColorDark ?? radioFillColorDark,
switchActiveColor: other.switchActiveColor ?? switchActiveColor,
switchActiveColorLight:
other.switchActiveColorLight ?? switchActiveColorLight,
switchActiveColorDark:
other.switchActiveColorDark ?? switchActiveColorDark,
switchInactiveColor: other.switchInactiveColor ?? switchInactiveColor,
switchInactiveColorLight:
other.switchInactiveColorLight ?? switchInactiveColorLight,
switchInactiveColorDark:
other.switchInactiveColorDark ?? switchInactiveColorDark,
switchTrackColor: other.switchTrackColor ?? switchTrackColor,
switchTrackColorLight:
other.switchTrackColorLight ?? switchTrackColorLight,
switchTrackColorDark: other.switchTrackColorDark ?? switchTrackColorDark,
sliderActiveColor: other.sliderActiveColor ?? sliderActiveColor,
sliderActiveColorLight:
other.sliderActiveColorLight ?? sliderActiveColorLight,
sliderActiveColorDark:
other.sliderActiveColorDark ?? sliderActiveColorDark,
sliderInactiveColor: other.sliderInactiveColor ?? sliderInactiveColor,
sliderInactiveColorLight:
other.sliderInactiveColorLight ?? sliderInactiveColorLight,
sliderInactiveColorDark:
other.sliderInactiveColorDark ?? sliderInactiveColorDark,
sliderThumbColor: other.sliderThumbColor ?? sliderThumbColor,
sliderThumbColorLight:
other.sliderThumbColorLight ?? sliderThumbColorLight,
sliderThumbColorDark: other.sliderThumbColorDark ?? sliderThumbColorDark,
progressIndicatorColor:
other.progressIndicatorColor ?? progressIndicatorColor,
progressIndicatorColorLight:
other.progressIndicatorColorLight ?? progressIndicatorColorLight,
progressIndicatorColorDark:
other.progressIndicatorColorDark ?? progressIndicatorColorDark,
progressIndicatorBackgroundColor:
other.progressIndicatorBackgroundColor ??
progressIndicatorBackgroundColor,
progressIndicatorBackgroundColorLight:
other.progressIndicatorBackgroundColorLight ??
progressIndicatorBackgroundColorLight,
progressIndicatorBackgroundColorDark:
other.progressIndicatorBackgroundColorDark ??
progressIndicatorBackgroundColorDark,
circularProgressStrokeWidth:
other.circularProgressStrokeWidth ?? circularProgressStrokeWidth,
tooltipBackgroundColor:
other.tooltipBackgroundColor ?? tooltipBackgroundColor,
tooltipTextStyle: other.tooltipTextStyle ?? tooltipTextStyle,
tooltipPadding: other.tooltipPadding ?? tooltipPadding,
dividerColor: other.dividerColor ?? dividerColor,
dividerColorLight: other.dividerColorLight ?? dividerColorLight,
dividerColorDark: other.dividerColorDark ?? dividerColorDark,
dividerThickness: other.dividerThickness ?? dividerThickness,
dividerIndent: other.dividerIndent ?? dividerIndent,
listTileIconColor: other.listTileIconColor ?? listTileIconColor,
listTileIconColorLight:
other.listTileIconColorLight ?? listTileIconColorLight,
listTileIconColorDark:
other.listTileIconColorDark ?? listTileIconColorDark,
listTileTitleStyle: other.listTileTitleStyle ?? listTileTitleStyle,
listTileSubtitleStyle:
other.listTileSubtitleStyle ?? listTileSubtitleStyle,
listTileSelectedColor:
other.listTileSelectedColor ?? listTileSelectedColor,
listTileSelectedColorLight:
other.listTileSelectedColorLight ?? listTileSelectedColorLight,
listTileSelectedColorDark:
other.listTileSelectedColorDark ?? listTileSelectedColorDark,
tabBarIndicatorColor: other.tabBarIndicatorColor ?? tabBarIndicatorColor,
tabBarIndicatorColorLight:
other.tabBarIndicatorColorLight ?? tabBarIndicatorColorLight,
tabBarIndicatorColorDark:
other.tabBarIndicatorColorDark ?? tabBarIndicatorColorDark,
tabBarLabelColor: other.tabBarLabelColor ?? tabBarLabelColor,
tabBarLabelColorLight:
other.tabBarLabelColorLight ?? tabBarLabelColorLight,
tabBarLabelColorDark: other.tabBarLabelColorDark ?? tabBarLabelColorDark,
tabBarUnselectedLabelColor:
other.tabBarUnselectedLabelColor ?? tabBarUnselectedLabelColor,
tabBarUnselectedLabelColorLight:
other.tabBarUnselectedLabelColorLight ??
tabBarUnselectedLabelColorLight,
tabBarUnselectedLabelColorDark:
other.tabBarUnselectedLabelColorDark ??
tabBarUnselectedLabelColorDark,
tabBarIndicatorWeight:
other.tabBarIndicatorWeight ?? tabBarIndicatorWeight,
dataTableHeadingRowColor:
other.dataTableHeadingRowColor ?? dataTableHeadingRowColor,
dataTableHeadingRowColorLight:
other.dataTableHeadingRowColorLight ?? dataTableHeadingRowColorLight,
dataTableHeadingRowColorDark:
other.dataTableHeadingRowColorDark ?? dataTableHeadingRowColorDark,
dataTableDataRowColor:
other.dataTableDataRowColor ?? dataTableDataRowColor,
dataTableDataRowColorLight:
other.dataTableDataRowColorLight ?? dataTableDataRowColorLight,
dataTableDataRowColorDark:
other.dataTableDataRowColorDark ?? dataTableDataRowColorDark,
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,
badgeBackgroundColorLight:
other.badgeBackgroundColorLight ?? badgeBackgroundColorLight,
badgeBackgroundColorDark:
other.badgeBackgroundColorDark ?? badgeBackgroundColorDark,
badgeTextColor: other.badgeTextColor ?? badgeTextColor,
badgeTextColorLight: other.badgeTextColorLight ?? badgeTextColorLight,
badgeTextColorDark: other.badgeTextColorDark ?? badgeTextColorDark,
searchBarBackgroundLight:
other.searchBarBackgroundLight ?? searchBarBackgroundLight,
searchBarBackgroundDark:
other.searchBarBackgroundDark ?? searchBarBackgroundDark,
searchBarElevation: other.searchBarElevation ?? searchBarElevation,
searchBarHintStyle: other.searchBarHintStyle ?? searchBarHintStyle,
segmentedButtonSelectedColor:
other.segmentedButtonSelectedColor ?? segmentedButtonSelectedColor,
segmentedButtonSelectedColorLight:
other.segmentedButtonSelectedColorLight ??
segmentedButtonSelectedColorLight,
segmentedButtonSelectedColorDark:
other.segmentedButtonSelectedColorDark ??
segmentedButtonSelectedColorDark,
segmentedButtonForegroundColor:
other.segmentedButtonForegroundColor ??
segmentedButtonForegroundColor,
segmentedButtonForegroundColorLight:
other.segmentedButtonForegroundColorLight ??
segmentedButtonForegroundColorLight,
segmentedButtonForegroundColorDark:
other.segmentedButtonForegroundColorDark ??
segmentedButtonForegroundColorDark,
popupMenuBackgroundLight:
other.popupMenuBackgroundLight ?? popupMenuBackgroundLight,
popupMenuBackgroundDark:
other.popupMenuBackgroundDark ?? popupMenuBackgroundDark,
popupMenuElevation: other.popupMenuElevation ?? popupMenuElevation,
popupMenuShape: other.popupMenuShape ?? popupMenuShape,
expansionTileBackgroundColor:
other.expansionTileBackgroundColor ?? expansionTileBackgroundColor,
expansionTileBackgroundColorLight:
other.expansionTileBackgroundColorLight ??
expansionTileBackgroundColorLight,
expansionTileBackgroundColorDark:
other.expansionTileBackgroundColorDark ??
expansionTileBackgroundColorDark,
expansionTileCollapsedBackgroundColor:
other.expansionTileCollapsedBackgroundColor ??
expansionTileCollapsedBackgroundColor,
expansionTileCollapsedBackgroundColorLight:
other.expansionTileCollapsedBackgroundColorLight ??
expansionTileCollapsedBackgroundColorLight,
expansionTileCollapsedBackgroundColorDark:
other.expansionTileCollapsedBackgroundColorDark ??
expansionTileCollapsedBackgroundColorDark,
expansionTileIconColor:
other.expansionTileIconColor ?? expansionTileIconColor,
expansionTileIconColorLight:
other.expansionTileIconColorLight ?? expansionTileIconColorLight,
expansionTileIconColorDark:
other.expansionTileIconColorDark ?? expansionTileIconColorDark,
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,
);
}