MVP #141

Merged
flixcoo merged 705 commits from development into main 2026-01-09 12:55:50 +00:00
Showing only changes of commit 9ac6b6e04c - Show all commits

View File

@@ -6,25 +6,24 @@ import 'package:intl/intl.dart';
class GameHistoryTile extends StatefulWidget {
final Game game;
final VoidCallback onTap;
const GameHistoryTile({
super.key,
required this.game,
});
const GameHistoryTile({super.key, required this.game, required this.onTap});
@override
State<GameHistoryTile> createState() => _GameHistoryTileState();
}
class _GameHistoryTileState extends State<GameHistoryTile> {
@override
Widget build(BuildContext context) {
final group = widget.game.group;
final winner = widget.game.winner;
final allPlayers = _getAllPlayers();
return Container(
return GestureDetector(
onTap: widget.onTap,
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
@@ -50,10 +49,7 @@ class _GameHistoryTileState extends State<GameHistoryTile> {
),
Text(
_formatDate(widget.game.createdAt),
style: const TextStyle(
fontSize: 12,
color: Colors.grey,
),
style: const TextStyle(fontSize: 12, color: Colors.grey),
),
],
),
@@ -63,19 +59,12 @@ class _GameHistoryTileState extends State<GameHistoryTile> {
if (group != null) ...[
Row(
children: [
const Icon(
Icons.group,
size: 16,
color: Colors.grey,
),
const Icon(Icons.group, size: 16, color: Colors.grey),
const SizedBox(width: 6),
Expanded(
child: Text(
group.name,
style: const TextStyle(
fontSize: 14,
color: Colors.grey,
),
style: const TextStyle(fontSize: 14, color: Colors.grey),
overflow: TextOverflow.ellipsis,
),
),
@@ -86,7 +75,10 @@ class _GameHistoryTileState extends State<GameHistoryTile> {
if (winner != null) ...[
Container(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
padding: const EdgeInsets.symmetric(
vertical: 8,
horizontal: 12,
),
decoration: BoxDecoration(
color: Colors.green.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(8),
@@ -134,15 +126,13 @@ class _GameHistoryTileState extends State<GameHistoryTile> {
spacing: 6,
runSpacing: 6,
children: allPlayers.map((player) {
return TextIconTile(
text: player.name,
iconEnabled: false,
);
return TextIconTile(text: player.name, iconEnabled: false);
}).toList(),
),
],
],
),
),
);
}
@@ -187,5 +177,4 @@ class _GameHistoryTileState extends State<GameHistoryTile> {
return allPlayers;
}
}