findByCol method

List<ChessItem> findByCol(
  1. int col, [
  2. int? min,
  3. int? max
])

Find item in a col

Implementation

List<ChessItem> findByCol(int col, [int? min, int? max]) {
  List<ChessItem> items = [];
  for (int i = min ?? 0; i <= (max ?? _rows.length - 1); i++) {
    if (_rows[i][col] != '0') {
      items.add(ChessItem(_rows[i][col], position: ChessPos(col, i)));
    }
  }
  return items;
}