copyWith method
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,
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: style == null ? this.style : this.style.merge(style),
headerStyle: headerStyle == null
? this.headerStyle
: this.headerStyle.merge(headerStyle),
);
}