From 2e562b95c164d15e2dde859971e2529062d3199d Mon Sep 17 00:00:00 2001 From: mdakin Date: Wed, 30 Sep 2015 23:15:55 +0200 Subject: [PATCH] Fix bounds checking error I introduced in previour cl, Address style issues. --- examples/mine_digger/lib/main.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/mine_digger/lib/main.dart b/examples/mine_digger/lib/main.dart index bd1fff8e9e7..91498eb4055 100644 --- a/examples/mine_digger/lib/main.dart +++ b/examples/mine_digger/lib/main.dart @@ -31,8 +31,9 @@ const List textColors = const [ const Color(0xFF000000), ]; -final List textStyles = textColors.map((c) => - new TextStyle(color: c, fontWeight: bold, textAlign: TextAlign.center)).toList(); +final List textStyles = textColors.map((color) { + return new TextStyle(color: color, fontWeight: bold, textAlign: TextAlign.center); +}).toList(); enum CellState { covered, exploded, cleared, flagged, shown } @@ -272,8 +273,7 @@ class MineDiggerState extends State { int bombs(int x, int y) => inBoard(x, y) && cells[y][x] ? 1 : 0; - bool inBoard(int x, int y) => - (x > 0 && x < (cols - 1) && y > 0 && y < (rows -1)); + bool inBoard(int x, int y) => x >= 0 && x < cols && y >= 0 && y < rows; } Widget buildCell(Widget child) {