Updated game tile
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 46s
Pull Request Pipeline / lint (pull_request) Successful in 50s
Pull Request Pipeline / localizations (pull_request) Successful in 27s

This commit is contained in:
2026-05-23 01:18:16 +02:00
parent a1b2a1d722
commit 3c9d115d08
2 changed files with 20 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ import 'package:tallee/core/enums.dart';
class GameTile extends StatelessWidget {
/// A list tile widget that displays a title and description, with optional highlighting and badge.
/// - [title]: The title text displayed on the tile.
/// - [subtitle]: An optional subtitle displayed under the title.
/// - [description]: The description text displayed below the title.
/// - [onTap]: The callback invoked when the tile is tapped.
/// - [onLongPress]: The callback invoked when the tile is tapped.
@@ -17,6 +18,7 @@ class GameTile extends StatelessWidget {
super.key,
required this.title,
required this.description,
this.subtitle,
this.onTap,
this.onLongPress,
this.isHighlighted = false,
@@ -24,25 +26,20 @@ class GameTile extends StatelessWidget {
this.badgeColor,
});
/// The title text displayed on the tile.
final String title;
/// The description text displayed below the title.
final String? subtitle;
final String description;
/// The callback invoked when the tile is tapped.
final VoidCallback? onTap;
/// The callback invoked when the tile is long-pressed.
final VoidCallback? onLongPress;
/// A boolean to determine if the tile should be highlighted.
final bool isHighlighted;
/// Optional text to display in a badge on the right side of the title.
final String? badgeText;
/// Optional color for the badge background.
final Color? badgeColor;
@override
@@ -119,6 +116,21 @@ class GameTile extends StatelessWidget {
),
),
// Title
if (subtitle != null && subtitle!.isNotEmpty) ...[
const SizedBox(height: 4),
Text(
subtitle!,
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: false,
style: const TextStyle(
fontSize: 14,
color: CustomTheme.hintColor,
),
),
],
// Badge
if (badgeText != null) ...[
const SizedBox(height: 5),