getSquareNotifier method Null safety

SquareNotifier getSquareNotifier(
  1. String squareName
)

Implementation

SquareNotifier getSquareNotifier(String squareName) {
  final index = _chessboard.squares
      .indexWhere((element) => element.value.squareName == squareName);
  return _chessboard.squares.elementAt(index);
}