copyWith method

TChip copyWith({
  1. String? text,
  2. dynamic icon,
  3. Widget? trailing,
  4. Color? color,
  5. Color? background,
  6. Color? textColor,
  7. VoidCallback? onTap,
  8. EdgeInsets? padding,
  9. BorderRadius? borderRadius,
  10. TVariant? type,
  11. TSize? size,
})

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

Implementation

TChip copyWith({
  String? text,
  dynamic icon,
  Widget? trailing,
  Color? color,
  Color? background,
  Color? textColor,
  VoidCallback? onTap,
  EdgeInsets? padding,
  BorderRadius? borderRadius,
  TVariant? type,
  TSize? size,
}) {
  return TChip(
    key: key,
    text: text ?? this.text,
    icon: icon ?? this.icon,
    trailing: trailing ?? this.trailing,
    color: color ?? this.color,
    background: background ?? this.background,
    textColor: textColor ?? this.textColor,
    onTap: onTap ?? this.onTap,
    padding: padding ?? this.padding,
    borderRadius: borderRadius ?? this.borderRadius,
    type: type ?? this.type,
    size: size ?? this.size,
  );
}