merge method
This style with the non-null properties of other layered on top.
Merging is per-property, not wholesale: overriding only cellSize keeps every resolved colour.
Implementation
FluentCalendarStyle merge(FluentCalendarStyle? other) {
if (other == null) return this;
return FluentCalendarStyle(
backgroundColor: other.backgroundColor ?? backgroundColor,
borderColor: other.borderColor ?? borderColor,
borderWidth: other.borderWidth ?? borderWidth,
borderRadius: other.borderRadius ?? borderRadius,
shadow: other.shadow ?? shadow,
padding: other.padding ?? padding,
gap: other.gap ?? gap,
dividerColor: other.dividerColor ?? dividerColor,
dividerWidth: other.dividerWidth ?? dividerWidth,
headerTextStyle: other.headerTextStyle ?? headerTextStyle,
headerForegroundColor:
other.headerForegroundColor ?? headerForegroundColor,
headerBackgroundColor:
other.headerBackgroundColor ?? headerBackgroundColor,
headerPadding: other.headerPadding ?? headerPadding,
headerBorderRadius: other.headerBorderRadius ?? headerBorderRadius,
headerHeight: other.headerHeight ?? headerHeight,
navButtonSize: other.navButtonSize ?? navButtonSize,
navButtonForegroundColor:
other.navButtonForegroundColor ?? navButtonForegroundColor,
navButtonBackgroundColor:
other.navButtonBackgroundColor ?? navButtonBackgroundColor,
navButtonBorderRadius:
other.navButtonBorderRadius ?? navButtonBorderRadius,
navIconSize: other.navIconSize ?? navIconSize,
weekdayTextStyle: other.weekdayTextStyle ?? weekdayTextStyle,
weekdayForegroundColor:
other.weekdayForegroundColor ?? weekdayForegroundColor,
cellSize: other.cellSize ?? cellSize,
cellSpacing: other.cellSpacing ?? cellSpacing,
rowSpacing: other.rowSpacing ?? rowSpacing,
dayButtonSize: other.dayButtonSize ?? dayButtonSize,
cellBorderRadius: other.cellBorderRadius ?? cellBorderRadius,
cellTextStyle: other.cellTextStyle ?? cellTextStyle,
cellBackgroundColor: other.cellBackgroundColor ?? cellBackgroundColor,
cellForegroundColor: other.cellForegroundColor ?? cellForegroundColor,
outOfPageForegroundColor:
other.outOfPageForegroundColor ?? outOfPageForegroundColor,
todayBackgroundColor: other.todayBackgroundColor ?? todayBackgroundColor,
todayForegroundColor: other.todayForegroundColor ?? todayForegroundColor,
todayMarkerSize: other.todayMarkerSize ?? todayMarkerSize,
selectedBackgroundColor:
other.selectedBackgroundColor ?? selectedBackgroundColor,
selectedForegroundColor:
other.selectedForegroundColor ?? selectedForegroundColor,
selectedBorderColor: other.selectedBorderColor ?? selectedBorderColor,
selectedBorderWidth: other.selectedBorderWidth ?? selectedBorderWidth,
goToTodayTextStyle: other.goToTodayTextStyle ?? goToTodayTextStyle,
goToTodayForegroundColor:
other.goToTodayForegroundColor ?? goToTodayForegroundColor,
mouseCursor: other.mouseCursor ?? mouseCursor,
);
}