getSquare function

String getSquare(
  1. int rankIndex,
  2. int fileIndex,
  3. Color orientation
)

Implementation

String getSquare(int rankIndex, int fileIndex, Color orientation) {
  final rank = orientation == Color.BLACK ? rankIndex + 1 : 8 - rankIndex;
  final file = orientation == Color.BLACK ? 7 - fileIndex : fileIndex;
  return '${String.fromCharCode(file + 97)}$rank';
}