copyWith method

WCPDateSlotWidgetDecorations copyWith({
  1. EdgeInsets? internalPadding,
  2. BorderRadius? borderRadius,
  3. WCPDSWDMultiStateColletion<Border>? selectedBorder,
  4. WCPDSWDMultiStateColletion<Border>? notSelectedBorder,
  5. WCPDSWDMultiStateColletion<Color>? selectedBackgroundColor,
  6. WCPDSWDMultiStateColletion<Color>? notSelectedBackgroundColor,
  7. WCPDSWDMultiStateColletion<Color>? selectedTextColor,
  8. WCPDSWDMultiStateColletion<Color>? notSelectedTextColor,
  9. WCPDSWDMultiStateColletion<ZwapTextType>? selectedTextType,
  10. WCPDSWDMultiStateColletion<ZwapTextType>? notSelectedTextType,
  11. WCPDSWDMultiStateColletion<TextStyle>? selectedTextStyle,
  12. WCPDSWDMultiStateColletion<TextStyle>? notSelectedTextStyle,
  13. required bool hasCustomTextStyle,
})

If hasCustomTextStyle is true selectedTextColor, notSelectedTextColor, selectedTextType, notSelectedTextType will be null and only selectedTextStyle and notSelectedTextStyle will be copied

The expact dual case is hasCustomTextStyle is false

Implementation

WCPDateSlotWidgetDecorations copyWith({
  EdgeInsets? internalPadding,
  BorderRadius? borderRadius,
  WCPDSWDMultiStateColletion<Border>? selectedBorder,
  WCPDSWDMultiStateColletion<Border>? notSelectedBorder,
  WCPDSWDMultiStateColletion<Color>? selectedBackgroundColor,
  WCPDSWDMultiStateColletion<Color>? notSelectedBackgroundColor,
  WCPDSWDMultiStateColletion<Color>? selectedTextColor,
  WCPDSWDMultiStateColletion<Color>? notSelectedTextColor,
  WCPDSWDMultiStateColletion<ZwapTextType>? selectedTextType,
  WCPDSWDMultiStateColletion<ZwapTextType>? notSelectedTextType,
  WCPDSWDMultiStateColletion<TextStyle>? selectedTextStyle,
  WCPDSWDMultiStateColletion<TextStyle>? notSelectedTextStyle,
  required bool hasCustomTextStyle,
}) {
  if (hasCustomTextStyle)
    return WCPDateSlotWidgetDecorations.customTextStyle(
      internalPadding: internalPadding ?? this.internalPadding,
      borderRadius: borderRadius ?? this.borderRadius,
      selectedBorder: selectedBorder ?? this.selectedBorder,
      notSelectedBorder: notSelectedBorder ?? this.notSelectedBorder,
      selectedBackgroundColor: selectedBackgroundColor ?? this.selectedBackgroundColor,
      notSelectedBackgroundColor: notSelectedBackgroundColor ?? this.notSelectedBackgroundColor,
      selectedTextStyle: selectedTextStyle ?? this.selectedTextStyle,
      notSelectedTextStyle: notSelectedTextStyle ?? this.notSelectedTextStyle,
    );
  else
    return WCPDateSlotWidgetDecorations(
      internalPadding: internalPadding ?? this.internalPadding,
      borderRadius: borderRadius ?? this.borderRadius,
      selectedBorder: selectedBorder ?? this.selectedBorder,
      notSelectedBorder: notSelectedBorder ?? this.notSelectedBorder,
      selectedBackgroundColor: selectedBackgroundColor ?? this.selectedBackgroundColor,
      notSelectedBackgroundColor: notSelectedBackgroundColor ?? this.notSelectedBackgroundColor,
      selectedTextColor: selectedTextColor ?? this.selectedTextColor,
      notSelectedTextColor: notSelectedTextColor ?? this.notSelectedTextColor,
      selectedTextType: selectedTextType ?? this.selectedTextType,
      notSelectedTextType: notSelectedTextType ?? this.notSelectedTextType,
    );
}