April 2020
Intermediate to advanced
380 pages
9h 24m
English
After mapping the pieces to their initial positions, we can start placing actual image vectors:
Widget mapImages(String squareName) { board.putIfAbsent(squareName, () => " "); String p = board[squareName]; var size = 6.0; Widget imageToDisplay = Container(); switch (p) { case "P": imageToDisplay = WhitePawn(size: size); break; case "R": imageToDisplay = WhiteRook(size: size); break; case "N": imageToDisplay = WhiteKnight(size: size); break; case "B": imageToDisplay = WhiteBishop(size: size); break; case "Q": imageToDisplay = WhiteQueen(size: size); ...Read now
Unlock full access