From 6cbc64c0421f4291e3b9252f3aebd8348f79b8c9 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Tue, 11 Nov 2025 15:34:16 +0100 Subject: [PATCH] Simplified game tile --- lib/presentation/widgets/game_tile.dart | 126 +++++++++++++----------- 1 file changed, 67 insertions(+), 59 deletions(-) diff --git a/lib/presentation/widgets/game_tile.dart b/lib/presentation/widgets/game_tile.dart index 546531c..c79a6b7 100644 --- a/lib/presentation/widgets/game_tile.dart +++ b/lib/presentation/widgets/game_tile.dart @@ -2,7 +2,20 @@ import 'package:flutter/material.dart'; import 'package:game_tracker/core/custom_theme.dart'; class GameTile extends StatefulWidget { - const GameTile({super.key}); + final String gameTitle; + final String gameType; + final String ruleset; + final String players; + final String winner; + + const GameTile({ + super.key, + required this.gameTitle, + required this.gameType, + required this.ruleset, + required this.players, + required this.winner, + }); @override State createState() => _GameTileState(); @@ -11,72 +24,67 @@ class GameTile extends StatefulWidget { class _GameTileState extends State { @override Widget build(BuildContext context) { - return Container( - padding: const EdgeInsets.all(12), - height: 120, - width: 250, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: CustomTheme.boxColor, - border: Border.all(color: CustomTheme.boxBorder), - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Row( - children: [ - Text( - 'Gametitle', - style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), - ), - SizedBox(width: 5), - Text( - 'Gametype', - style: TextStyle(fontSize: 14, color: Colors.grey), - ), - ], + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + widget.gameTitle, + style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + const SizedBox(width: 5), + Text( + widget.gameType, + style: const TextStyle(fontSize: 14, color: Colors.grey), + ), + ], + ), + const SizedBox(height: 5), + Container( + padding: const EdgeInsets.symmetric(horizontal: 4), + height: 20, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: CustomTheme.primaryColor, ), - const SizedBox(height: 5), - Container( + child: Text( + widget.ruleset, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + ), + Center( + heightFactor: 1.5, + child: Text( + widget.players, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + ), + Center( + child: Container( padding: const EdgeInsets.symmetric(horizontal: 4), - height: 20, + width: 220, decoration: BoxDecoration( borderRadius: BorderRadius.circular(4), - color: CustomTheme.primaryColor, + color: Colors.yellow.shade300, ), - child: const Text( - 'Ruleset', - style: TextStyle(fontWeight: FontWeight.bold), - ), - ), - const Center( - child: Text( - '5 Player', - style: TextStyle(fontWeight: FontWeight.bold), - ), - ), - const Spacer(), - Center( - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 4), - width: 220, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(4), - color: Colors.yellow.shade300, - ), - child: const Text( - 'In Progress', - textAlign: TextAlign.center, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black87, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(Icons.emoji_events, color: Colors.black, size: 20), + Text( + widget.winner, + textAlign: TextAlign.center, + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black87, + ), ), - ), + ], ), ), - ], - ), + ), + ], ); } }