makeMove method

bool makeMove({
  1. required String from,
  2. required String to,
  3. String? promotion,
})

Implementation

bool makeMove({
  required final String from,
  required final String to,
  final String? promotion,
}) {
  final moveMade = promotion != null
      ? game.move({fromKey: from, toKey: to, promotionKey: promotion})
      : game.move({fromKey: from, toKey: to});
  if (moveMade) {
    _notifyListeners();
    return true;
  }
  return false;
}