Commit 8fb59f1d authored by Adam Barth's avatar Adam Barth

Merge pull request #1416 from mdakin/minedigger2

Fix bounds checking error I introduced in previour cl, Address style …
parents 43190374 e509cd7d
......@@ -31,8 +31,9 @@ const List<Color> textColors = const <Color>[
const Color(0xFF000000),
];
final List<TextStyle> textStyles = textColors.map((c) =>
new TextStyle(color: c, fontWeight: bold, textAlign: TextAlign.center)).toList();
final List<TextStyle> 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<MineDigger> {
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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment