withAction method
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]);