withPiece method

Variant withPiece(
  1. String key,
  2. PieceType pieceType
)

Copies the variant with a single piece added/updated.

Implementation

Variant withPiece(String key, PieceType pieceType) =>
    withPieces({key: pieceType});