copyWith method

Piece copyWith({
  1. Side? color,
  2. Role? role,
  3. bool? promoted,
})

Implementation

Piece copyWith({
  Side? color,
  Role? role,
  bool? promoted,
}) {
  return Piece(
    color: color ?? this.color,
    role: role ?? this.role,
    promoted: promoted ?? this.promoted,
  );
}