diff --git a/android/gradle.properties b/android/gradle.properties index 6118848e45e5b2812e30e4c952c553d56130666e..08cf16382c398c863c470adf971e9e4a678fc801 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.1.12 -app.versionCode=36 +app.versionName=0.1.13 +app.versionCode=37 diff --git a/assets/menu/game-pick-image.png b/assets/menu/game-pick-image.png new file mode 100644 index 0000000000000000000000000000000000000000..41b9c4dcb36e9dac5bbf75619667ba417d2d4df2 Binary files /dev/null and b/assets/menu/game-pick-image.png differ diff --git a/assets/menu/game-pick-word.png b/assets/menu/game-pick-word.png new file mode 100644 index 0000000000000000000000000000000000000000..c8ec3fc75d7bbc80e36c62fff24934e13771a387 Binary files /dev/null and b/assets/menu/game-pick-word.png differ diff --git a/lib/screens/home.dart b/lib/screens/home.dart index c4dbf4af1587e2fecbff1f97d79926c595e47ec1..75c3bd27e1be8321e7066d5dfaf05b8565d9e592 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -20,6 +20,41 @@ class Home extends StatelessWidget { Widget build(BuildContext context) { Data _myProvider = Provider.of<Data>(context); + Container _buildMenuItemContainer(String code, Color color) { + double imageSize = 150; + + String imageAsset = 'assets/menu/' + code + '.png'; + + return Container( + margin: EdgeInsets.all(2), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: Colors.teal, + width: 8, + ), + ), + child: FlatButton( + color: color, + padding: EdgeInsets.all(15), + child: Image( + image: AssetImage(imageAsset), + width: imageSize, + height: imageSize, + fit: BoxFit.fill + ), + onPressed: () { + resetGame(_myProvider); + Navigator.pushNamed( + context, + '/' + code, + ); + }, + ), + ); + } + + return Scaffold( backgroundColor: Colors.blue, body: Center( @@ -28,42 +63,8 @@ class Home extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: <Widget>[ - FlatButton( - color: Colors.green, - padding: EdgeInsets.all(15), - child: Text( - '🖼️ ➡️ 💬', - style: Theme.of(context) - .textTheme - .display1 - .copyWith(color: Colors.white), - ), - onPressed: () { - resetGame(_myProvider); - Navigator.pushNamed( - context, - '/game-pick-word', - ); - }, - ), - FlatButton( - color: Colors.green, - padding: EdgeInsets.all(15), - child: Text( - '💬️ ➡️ 🖼', - style: Theme.of(context) - .textTheme - .display1 - .copyWith(color: Colors.white), - ), - onPressed: () { - resetGame(_myProvider); - Navigator.pushNamed( - context, - '/game-pick-image', - ); - }, - ), + _buildMenuItemContainer('game-pick-word', Colors.pink), + _buildMenuItemContainer('game-pick-image', Colors.yellow), ], ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 925fde5b67aeb7cab7c7274b84836fbc4fd6fb1c..3673be2c89d708e3c30e6e7fc6db960566ee4dd0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -22,4 +22,5 @@ flutter: - assets/assets_images.json - assets/files/ - assets/images/ + - assets/menu/ - assets/placeholder.png