addMove method
Add a new move to history
Implementation
void addMove({
required String move,
required String fen,
String? san,
}) {
// If we're not at the end of history, truncate future moves
if (_currentIndex < _history.length - 1) {
_history.removeRange(_currentIndex + 1, _history.length);
}
final historyMove = HistoryMove(
move: move,
fen: fen,
san: san,
timestamp: DateTime.now(),
);
_history.add(historyMove);
_currentIndex = _history.length - 1;
}