From a78f1cd9f5375f9a67d1f5b17faa4df50cc06677 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sat, 7 Nov 2020 02:34:35 +0800 Subject: [PATCH] =?UTF-8?q?flutter:=20=E4=BF=AE=E6=94=B9=20BoardWidget=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/flutter/lib/board/board-widget.dart | 14 +++++++------- src/ui/flutter/lib/board/words-on-board.dart | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ui/flutter/lib/board/board-widget.dart b/src/ui/flutter/lib/board/board-widget.dart index 5ba8405b..da14a31c 100644 --- a/src/ui/flutter/lib/board/board-widget.dart +++ b/src/ui/flutter/lib/board/board-widget.dart @@ -41,9 +41,9 @@ class BoardWidget extends StatelessWidget { child: Container( margin: EdgeInsets.symmetric( vertical: padding, - horizontal: (width - padding * 2) / 7 / 2 + + horizontal: (width - padding * 2) / 6 / 2 + padding - - WordsOnBoard.DigitsFontSize / 2, + WordsOnBoard.digitsFontSize / 2, ), //child: WordsOnBoard(), ), @@ -54,18 +54,18 @@ class BoardWidget extends StatelessWidget { child: boardContainer, onTapUp: (d) { // - final gridWidth = (width - padding * 2) * 6 / 7; - final squareSide = gridWidth / 8; + final gridWidth = (width - padding * 2); + final squareWidth = gridWidth / 6; final dx = d.localPosition.dx, dy = d.localPosition.dy; - final row = (dy - padding - digitsHeight) ~/ squareSide; - final column = (dx - padding) ~/ squareSide; + final row = (dy - padding - digitsHeight) ~/ squareWidth; + final column = (dx - padding) ~/ squareWidth; if (row < 0 || row > 6) return; if (column < 0 || column > 6) return; - onBoardTap(context, row * 7 + column); + onBoardTap(context, row * 6 + column); }, ); } diff --git a/src/ui/flutter/lib/board/words-on-board.dart b/src/ui/flutter/lib/board/words-on-board.dart index 7f58ce28..fdb02838 100644 --- a/src/ui/flutter/lib/board/words-on-board.dart +++ b/src/ui/flutter/lib/board/words-on-board.dart @@ -4,7 +4,7 @@ import '../common/color-consts.dart'; class WordsOnBoard extends StatelessWidget { // - static const DigitsFontSize = 18.0; + static const digitsFontSize = 18.0; @override Widget build(BuildContext context) {