copyWith method

  1. @override
TextFieldCell copyWith({
  1. double? cellWidth,
  2. double? cellHeight,
  3. double? textSize,
})
override

Implementation

@override
TextFieldCell copyWith({
  double? cellWidth,
  double? cellHeight,
  double? textSize,
}) {
  return TextFieldCell(
    key: key,
    // 4. CRITICAL: Pass the existing controller so text is not lost on resize!
    controller: controller,
    onChanged: onChanged,
    cellWidth: cellWidth ?? this.cellWidth,
    cellHeight: cellHeight ?? this.cellHeight,
    textSize: textSize ?? this.textSize,
    textAlignment: textAlignment,
    backgroundColor: backgroundColor,
    textColor: textColor,
    borderColor: borderColor,
    isBold: isBold,
    decoration: decoration,
  );
}