copyWith method

S2ModalConfig copyWith({
  1. S2ModalType type,
  2. String title,
  3. bool useHeader,
  4. bool useConfirm,
  5. Icon confirmIcon,
  6. Widget confirmLabel,
  7. Color confirmColor,
  8. EdgeInsetsGeometry confirmMargin,
  9. Brightness confirmBrightness,
  10. bool useFilter,
  11. bool filterAuto,
  12. Duration filterDelay,
  13. String filterHint,
  14. double maxHeightFactor,
  15. bool enableDrag,
  16. bool barrierDismissible,
  17. Color barrierColor,
  18. S2ModalStyle style,
  19. S2ModalHeaderStyle headerStyle,
})

Creates a copy of this S2ModalConfig but with the given fields replaced with the new values.

Implementation

S2ModalConfig copyWith({
  S2ModalType type,
  String title,
  bool useHeader,
  bool useConfirm,
  Icon confirmIcon,
  Widget confirmLabel,
  Color confirmColor,
  EdgeInsetsGeometry confirmMargin,
  Brightness confirmBrightness,
  bool useFilter,
  bool filterAuto,
  Duration filterDelay,
  String filterHint,
  double maxHeightFactor,
  bool enableDrag,
  bool barrierDismissible,
  Color barrierColor,
  S2ModalStyle style,
  S2ModalHeaderStyle headerStyle,
}) {
  return S2ModalConfig(
    type: type ?? this.type,
    title: title ?? this.title,
    useHeader: useHeader ?? this.useHeader,
    useConfirm: useConfirm ?? this.useConfirm,
    confirmIcon: confirmIcon ?? this.confirmIcon,
    confirmLabel: confirmLabel ?? this.confirmLabel,
    confirmColor: confirmColor ?? this.confirmColor,
    confirmMargin: confirmMargin ?? this.confirmMargin,
    confirmBrightness: confirmBrightness ?? this.confirmBrightness,
    useFilter: useFilter ?? this.useFilter,
    filterAuto: filterAuto ?? this.filterAuto,
    filterDelay: filterDelay ?? this.filterDelay,
    filterHint: filterHint ?? this.filterHint,
    maxHeightFactor: maxHeightFactor ?? this.maxHeightFactor,
    enableDrag: enableDrag ?? this.enableDrag,
    barrierDismissible: barrierDismissible ?? this.barrierDismissible,
    barrierColor: barrierColor ?? this.barrierColor,
    style: this.style?.merge(style) ?? style,
    headerStyle: this.headerStyle?.merge(headerStyle) ?? headerStyle,
  );
}