copyWith method

KoiTextElement copyWith({
  1. String? text,
  2. KoiTextSize? size,
  3. KoiTextSize? widthSize,
  4. bool clearWidthSize = false,
  5. KoiTextSize? heightSize,
  6. bool clearHeightSize = false,
  7. KoiTextAlign? align,
  8. bool? bold,
  9. bool? reverse,
  10. bool? underline,
  11. KoiUnderlineStyle? underlineStyle,
  12. KoiFontType? font,
})

Implementation

KoiTextElement copyWith({
  String? text,
  KoiTextSize? size,
  KoiTextSize? widthSize,
  bool clearWidthSize = false,
  KoiTextSize? heightSize,
  bool clearHeightSize = false,
  KoiTextAlign? align,
  bool? bold,
  bool? reverse,
  bool? underline,
  KoiUnderlineStyle? underlineStyle,
  KoiFontType? font,
}) {
  return KoiTextElement(
    text: text ?? this.text,
    size: size ?? this.size,
    widthSize: clearWidthSize ? null : (widthSize ?? this.widthSize),
    heightSize: clearHeightSize ? null : (heightSize ?? this.heightSize),
    align: align ?? this.align,
    bold: bold ?? this.bold,
    reverse: reverse ?? this.reverse,
    underline: underline ?? this.underline,
    underlineStyle: underlineStyle ?? this.underlineStyle,
    font: font ?? this.font,
  );
}