diff --git a/android/gradle.properties b/android/gradle.properties index bc2d95e8567abcfd41c26ebeb95fced48f43e773..818e87b23b224ced309ae5c147e5ed827826e237 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.1 -app.versionCode=1 +app.versionName=0.0.2 +app.versionCode=2 diff --git a/assets/icons/key.png b/assets/icons/key.png new file mode 100644 index 0000000000000000000000000000000000000000..ff392f68a742723127b23e7a863f877f04da2fc5 Binary files /dev/null and b/assets/icons/key.png differ diff --git a/icons/build_game_icons.sh b/icons/build_game_icons.sh index 39fada606d1b0ef8dd2a534d4efff70288414b81..2fddd00c1365f394427511ffa1649f078b253911 100755 --- a/icons/build_game_icons.sh +++ b/icons/build_game_icons.sh @@ -58,6 +58,7 @@ build_icon ${CURRENT_DIR}/button_back.svg ${BASE_DIR}/assets/icons/button_back build_icon ${CURRENT_DIR}/button_help.svg ${BASE_DIR}/assets/icons/button_help.png build_icon ${CURRENT_DIR}/button_start.svg ${BASE_DIR}/assets/icons/button_start.png build_icon ${CURRENT_DIR}/game_win.svg ${BASE_DIR}/assets/icons/game_win.png +build_icon ${CURRENT_DIR}/key.svg ${BASE_DIR}/assets/icons/key.png build_icon ${CURRENT_DIR}/lang_fr.svg ${BASE_DIR}/assets/icons/lang_fr.png build_icon ${CURRENT_DIR}/length_5.svg ${BASE_DIR}/assets/icons/length_5.png diff --git a/icons/key.svg b/icons/key.svg new file mode 100644 index 0000000000000000000000000000000000000000..4ce7f70f4645a2d4d682574b2981774b48581f87 --- /dev/null +++ b/icons/key.svg @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg enable-background="new 0 0 100 100" version="1.1" viewBox="0 0 102 102" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><radialGradient id="radialGradient1525" cx="28.886" cy="23.061" r="50.92" gradientTransform="matrix(1.0318 1.378 -.79998 .59897 23.21 -30.64)" gradientUnits="userSpaceOnUse"><stop stop-color="#adadad" offset="0"/><stop stop-color="#e8e8e8" offset="1"/></radialGradient></defs><rect x=".17153" y=".2307" width="101.84" height="101.77" ry="0" fill="url(#radialGradient1525)" stroke="#000" stroke-width="2.0362"/></svg> diff --git a/lib/layout/board.dart b/lib/layout/board.dart index b700b62c50fee00b4ef38876c844073ea73d2cea..bb722657c32dcf653eabf312e3c15b8f6538033b 100644 --- a/lib/layout/board.dart +++ b/lib/layout/board.dart @@ -57,7 +57,7 @@ class Board { List<String> tips = GameUtils.getTips(myProvider, word); - List<Column> tableCells = []; + List<TableCell> tableCells = []; for (int colIndex = 0; colIndex < wordLength; colIndex++) { String cellValue = ' '; if (word.length > colIndex) { @@ -70,8 +70,8 @@ class Board { } tableCells.add( - Column( - children: [ buildCellWidget(cellValue, cellTip) ] + TableCell( + child: buildCellWidget(cellValue, cellTip) ) ); }; @@ -83,7 +83,7 @@ class Board { } return Container( - margin: EdgeInsets.symmetric(horizontal: 30), + margin: EdgeInsets.symmetric(horizontal: 40), padding: EdgeInsets.all(2), child: Table( diff --git a/lib/layout/game.dart b/lib/layout/game.dart index 99adcc33c3ce6cfc420d1d38a24094ae68d6f0d1..d305e996640752ea4e371a1174993d8b96c49ad3 100644 --- a/lib/layout/game.dart +++ b/lib/layout/game.dart @@ -27,8 +27,8 @@ class Game { ); } - static FlatButton buildRestartGameButton(Data myProvider) { - return FlatButton( + static TextButton buildRestartGameButton(Data myProvider) { + return TextButton( child: Container( child: Image( image: AssetImage('assets/icons/button_back.png'), diff --git a/lib/layout/keyboard.dart b/lib/layout/keyboard.dart index 2aaa53a9edf827726b0507b8197b47ac41530d54..16ce8ddc85bece73b446b58aa7f391131ade3cb6 100644 --- a/lib/layout/keyboard.dart +++ b/lib/layout/keyboard.dart @@ -15,44 +15,62 @@ class Keyboard { ]; Widget buildKeyWidget(String key) { - String displayedText = key; + String keyText = key; if (key == '<') { - displayedText = '⬅️'; + keyText = '⬅️'; } else if (key == '!') { - displayedText = '☑️'; + keyText = '☑️'; } Color keyColor = Colors.black; - return FlatButton( - child: Text( - displayedText, - style: TextStyle( - color: keyColor, - fontSize: 30.0, - fontWeight: FontWeight.w800, + if (key == ' ') { + return SizedBox(); + } + + return Stack( + alignment: Alignment.center, + children: <Widget>[ + Image( + image: AssetImage('assets/icons/key.png'), + fit: BoxFit.fill + ), + Center( + child: TextButton( + style: TextButton.styleFrom( + padding: const EdgeInsets.all(0), + ), + child: Text( + keyText, + style: TextStyle( + color: keyColor, + fontSize: 30.0, + fontWeight: FontWeight.w800, + ), + textAlign: TextAlign.center + ), + onPressed: () { + if (key == '<') { + GameUtils.removeLetter(myProvider); + } else if (key == '!') { + GameUtils.submitWord(myProvider); + } else if (key != ' ') { + GameUtils.addLetter(myProvider, key); + } + }, + ) ), - textAlign: TextAlign.center - ), - onPressed: () { - if (key == '<') { - GameUtils.removeLetter(myProvider); - } else if (key == '!') { - GameUtils.submitWord(myProvider); - } else if (key != ' ') { - GameUtils.addLetter(myProvider, key); - } - }, + ] ); } List<TableRow> tableRows = []; keys.forEach((row) { - List<Column> tableCells = []; + List<TableCell> tableCells = []; row.forEach((key) { tableCells.add( - Column( - children: [ buildKeyWidget(key) ] + TableCell( + child: buildKeyWidget(key), ) ); }); @@ -68,12 +86,12 @@ class Keyboard { padding: EdgeInsets.all(2), child: Table( - defaultVerticalAlignment: TableCellVerticalAlignment.bottom, - border: TableBorder.all( - width: 2.0, - color: Colors.blue, - style: BorderStyle.solid, - ), + defaultVerticalAlignment: TableCellVerticalAlignment.middle, + // border: TableBorder.all( + // width: 2.0, + // color: Colors.blue, + // style: BorderStyle.solid, + // ), children: tableRows, ) ); diff --git a/lib/layout/parameters.dart b/lib/layout/parameters.dart index 9a6f7d4c6d144a13bb538f24ef7a5a3454dbd536..3a2ae03a6290e298620d7af2fed7aec3b3b674de 100644 --- a/lib/layout/parameters.dart +++ b/lib/layout/parameters.dart @@ -48,7 +48,7 @@ class Parameters { decorationImage, Column( children: [ - FlatButton( + TextButton( child: Container( child: Image( image: AssetImage('assets/icons/button_start.png'), @@ -91,15 +91,15 @@ class Parameters { ); } - static FlatButton _buildParameterButton(Data myProvider, String parameterCode, String parameterValue) { + static TextButton _buildParameterButton(Data myProvider, String parameterCode, String parameterValue) { String currentValue = myProvider.getParameterValue(parameterCode).toString(); bool isActive = (parameterValue == currentValue); String imageAsset = 'assets/icons/' + parameterCode + '_' + parameterValue + '.png'; - return FlatButton( - padding: EdgeInsets.all(2), + return TextButton( child: Container( + padding: EdgeInsets.all(2), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10), diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 1381d16b440973da96a90597717c719d2a262b58..03c6cd9269447ebc9e494f5526305d09edcb8524 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -31,7 +31,7 @@ class _HomeState extends State<Home> { if (myProvider.gameIsRunning) { menuActions = [ - FlatButton( + TextButton( child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(4),