copyWith method

TextPart copyWith({
  1. Object? text = unsetCopyWithValue,
  2. Object? thought = unsetCopyWithValue,
  3. Object? thoughtSignature = unsetCopyWithValue,
})

Creates a copy with replaced values.

Implementation

TextPart copyWith({
  Object? text = unsetCopyWithValue,
  Object? thought = unsetCopyWithValue,
  Object? thoughtSignature = unsetCopyWithValue,
}) {
  return TextPart(
    text == unsetCopyWithValue ? this.text : text! as String,
    thought: thought == unsetCopyWithValue ? this.thought : thought as bool?,
    thoughtSignature: thoughtSignature == unsetCopyWithValue
        ? this.thoughtSignature
        : thoughtSignature as List<int>?,
  );
}