withAction method

PieceType withAction(
  1. Action action, {
  2. bool first = false,
})

Returns a copy of the piece type with action added. If first is true, it will be added to the start of the list.

Implementation

PieceType withAction(Action action, {bool first = false}) =>
    copyWith(actions: first ? [action, ...actions] : [...actions, action]);