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, height: MediaQuery.paddingOf(context).bottom - 20,
); );
} }
return MatchTile( return Padding(
onTap: () async { padding: const EdgeInsets.only(bottom: 12.0),
Navigator.push( child: MatchTile(
context, onTap: () async {
CupertinoPageRoute( Navigator.push(
fullscreenDialog: true, context,
builder: (context) => MatchResultView( CupertinoPageRoute(
match: matches[index], fullscreenDialog: true,
onWinnerChanged: loadGames, 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. /// - [match]: The match data to be displayed.
/// - [onTap]: The callback invoked when the tile is tapped. /// - [onTap]: The callback invoked when the tile is tapped.
class MatchTile extends StatefulWidget { 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. /// The match data to be displayed.
final Match match; final Match match;
@@ -19,6 +24,8 @@ class MatchTile extends StatefulWidget {
/// The callback invoked when the tile is tapped. /// The callback invoked when the tile is tapped.
final VoidCallback onTap; final VoidCallback onTap;
final double? width;
@override @override
State<MatchTile> createState() => _MatchTileState(); State<MatchTile> createState() => _MatchTileState();
} }
@@ -41,7 +48,8 @@ class _MatchTileState extends State<MatchTile> {
return GestureDetector( return GestureDetector(
onTap: widget.onTap, onTap: widget.onTap,
child: Container( child: Container(
margin: CustomTheme.tileMargin, margin: EdgeInsets.zero,
width: widget.width,
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: CustomTheme.boxColor, color: CustomTheme.boxColor,

View File

@@ -1,7 +1,7 @@
name: game_tracker name: game_tracker
description: "Game Tracking App for Card Games" description: "Game Tracking App for Card Games"
publish_to: 'none' publish_to: 'none'
version: 0.0.1+21 version: 0.0.1+23
environment: environment:
sdk: ^3.8.1 sdk: ^3.8.1
@@ -9,11 +9,6 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: 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: ^2.27.0
drift_flutter: ^0.2.4 drift_flutter: ^0.2.4
path_provider: ^2.1.5 path_provider: ^2.1.5