Modified match tile

This commit is contained in:
2026-01-09 19:50:44 +01:00
parent c2394c3733
commit 349ff948de
3 changed files with 27 additions and 21 deletions

View File

@@ -78,20 +78,23 @@ class _MatchViewState extends State<MatchView> {
height: MediaQuery.paddingOf(context).bottom - 20,
);
}
return MatchTile(
onTap: () async {
Navigator.push(
context,
CupertinoPageRoute(
fullscreenDialog: true,
builder: (context) => MatchResultView(
match: matches[index],
onWinnerChanged: loadGames,
return Padding(
padding: const EdgeInsets.only(bottom: 12.0),
child: MatchTile(
onTap: () async {
Navigator.push(
context,
CupertinoPageRoute(
fullscreenDialog: true,
builder: (context) => MatchResultView(
match: matches[index],
onWinnerChanged: loadGames,
),
),
),
);
},
match: matches[index],
);
},
match: matches[index],
),
);
},
),

View File

@@ -11,7 +11,12 @@ import 'package:intl/intl.dart';
/// - [match]: The match data to be displayed.
/// - [onTap]: The callback invoked when the tile is tapped.
class MatchTile extends StatefulWidget {
const MatchTile({super.key, required this.match, required this.onTap});
const MatchTile({
super.key,
required this.match,
required this.onTap,
this.width,
});
/// The match data to be displayed.
final Match match;
@@ -19,6 +24,8 @@ class MatchTile extends StatefulWidget {
/// The callback invoked when the tile is tapped.
final VoidCallback onTap;
final double? width;
@override
State<MatchTile> createState() => _MatchTileState();
}
@@ -41,7 +48,8 @@ class _MatchTileState extends State<MatchTile> {
return GestureDetector(
onTap: widget.onTap,
child: Container(
margin: CustomTheme.tileMargin,
margin: EdgeInsets.zero,
width: widget.width,
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CustomTheme.boxColor,

View File

@@ -1,7 +1,7 @@
name: game_tracker
description: "Game Tracking App for Card Games"
publish_to: 'none'
version: 0.0.1+21
version: 0.0.1+23
environment:
sdk: ^3.8.1
@@ -9,11 +9,6 @@ environment:
dependencies:
flutter:
sdk: flutter
material_symbols_icons: ^4.2815.1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
drift: ^2.27.0
drift_flutter: ^0.2.4
path_provider: ^2.1.5