copyWith method
FlexiChipStyle
copyWith({
- double? height,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- Clip? clipBehavior,
- Color? overlayColor,
- Color? shadowColor,
- double? elevation,
- TextStyle? foregroundStyle,
- Color? foregroundColor,
- double? foregroundOpacity,
- int? foregroundAlpha,
- double? foregroundSpacing,
- Color? backgroundColor,
- double? backgroundOpacity,
- int? backgroundAlpha,
- Color? borderColor,
- double? borderOpacity,
- int? borderAlpha,
- double? borderWidth,
- BorderRadiusGeometry? borderRadius,
- BorderStyle? borderStyle,
- Size? avatarSize,
- TextStyle? avatarForegroundStyle,
- Color? avatarForegroundColor,
- Color? avatarBackgroundColor,
- BorderRadiusGeometry? avatarBorderRadius,
- Color? checkmarkColor,
- double? checkmarkSize,
- double? checkmarkWeight,
- FlexiChipCheckmarkStyle? checkmarkStyle,
- Color? iconColor,
- double? iconOpacity,
- double? iconSize,
- FlexiChipStyle? selectedStyle,
- FlexiChipStyle? disabledStyle,
- FlexiChipStyle? hoveredStyle,
- FlexiChipStyle? focusedStyle,
- FlexiChipStyle? pressedStyle,
Creates a copy of this FlexiChipStyle but with the given fields replaced with the new values.
Implementation
FlexiChipStyle copyWith({
double? height,
EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
Clip? clipBehavior,
Color? overlayColor,
Color? shadowColor,
double? elevation,
TextStyle? foregroundStyle,
Color? foregroundColor,
double? foregroundOpacity,
int? foregroundAlpha,
double? foregroundSpacing,
Color? backgroundColor,
double? backgroundOpacity,
int? backgroundAlpha,
Color? borderColor,
double? borderOpacity,
int? borderAlpha,
double? borderWidth,
BorderRadiusGeometry? borderRadius,
BorderStyle? borderStyle,
Size? avatarSize,
TextStyle? avatarForegroundStyle,
Color? avatarForegroundColor,
Color? avatarBackgroundColor,
BorderRadiusGeometry? avatarBorderRadius,
Color? checkmarkColor,
double? checkmarkSize,
double? checkmarkWeight,
FlexiChipCheckmarkStyle? checkmarkStyle,
Color? iconColor,
double? iconOpacity,
double? iconSize,
FlexiChipStyle? selectedStyle,
FlexiChipStyle? disabledStyle,
FlexiChipStyle? hoveredStyle,
FlexiChipStyle? focusedStyle,
FlexiChipStyle? pressedStyle,
}) {
final hasEvent = selectedStyle != null ||
disabledStyle != null ||
hoveredStyle != null ||
focusedStyle != null ||
pressedStyle != null;
final style = FlexiChipStyle(
height: height ?? this.height,
margin: margin ?? this.margin,
padding: padding ?? this.padding,
clipBehavior: clipBehavior ?? this.clipBehavior,
overlayColor: overlayColor ?? this.overlayColor,
shadowColor: shadowColor ?? this.shadowColor,
elevation: elevation ?? this.elevation,
foregroundStyle: foregroundStyle ?? this.foregroundStyle,
foregroundColor: foregroundColor ?? this.foregroundColor,
foregroundOpacity: foregroundOpacity ?? this.foregroundOpacity,
foregroundAlpha: foregroundAlpha ?? this.foregroundAlpha,
foregroundSpacing: foregroundSpacing ?? this.foregroundSpacing,
backgroundColor: backgroundColor ?? this.backgroundColor,
backgroundOpacity: backgroundOpacity ?? this.backgroundOpacity,
backgroundAlpha: backgroundAlpha ?? this.backgroundAlpha,
borderColor: borderColor ?? this.borderColor,
borderOpacity: borderOpacity ?? this.borderOpacity,
borderAlpha: borderAlpha ?? this.borderAlpha,
borderWidth: borderWidth ?? this.borderWidth,
borderRadius: borderRadius ?? this.borderRadius,
borderStyle: borderStyle ?? this.borderStyle,
avatarSize: avatarSize ?? this.avatarSize,
avatarForegroundStyle:
avatarForegroundStyle ?? this.avatarForegroundStyle,
avatarForegroundColor:
avatarForegroundColor ?? this.avatarForegroundColor,
avatarBackgroundColor:
avatarBackgroundColor ?? this.avatarBackgroundColor,
avatarBorderRadius: avatarBorderRadius ?? this.avatarBorderRadius,
checkmarkColor: checkmarkColor ?? this.checkmarkColor,
checkmarkSize: checkmarkSize ?? this.checkmarkSize,
checkmarkWeight: checkmarkWeight ?? this.checkmarkWeight,
checkmarkStyle: checkmarkStyle ?? this.checkmarkStyle,
iconColor: iconColor ?? this.iconColor,
iconOpacity: iconOpacity ?? this.iconOpacity,
iconSize: iconSize ?? this.iconSize,
);
return hasEvent
? FlexiChipStyle.when(
enabled: style,
selected: selectedStyle,
disabled: disabledStyle,
hovered: hoveredStyle,
focused: focusedStyle,
pressed: pressedStyle,
)
: style;
}