Adjusted cabo player highlighting

This commit is contained in:
2025-08-02 18:20:12 +02:00
parent 7518d006b8
commit 03462808c2
2 changed files with 44 additions and 42 deletions

View File

@@ -36,8 +36,8 @@ class _PointsViewState extends State<PointsView> {
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: tablePadding), padding: const EdgeInsets.symmetric(horizontal: tablePadding),
child: DataTable( child: DataTable(
dataRowMaxHeight: 65, dataRowMaxHeight: 75,
dataRowMinHeight: 65, dataRowMinHeight: 75,
columnSpacing: 0, columnSpacing: 0,
horizontalMargin: 0, horizontalMargin: 0,
columns: [ columns: [
@@ -96,45 +96,47 @@ class _PointsViewState extends State<PointsView> {
round.scoreUpdates[playerIndex]; round.scoreUpdates[playerIndex];
final bool saidCabo = final bool saidCabo =
round.caboPlayerIndex == playerIndex; round.caboPlayerIndex == playerIndex;
return DataCell( return DataCell(Center(
Center( child: Padding(
child: Column( padding: const EdgeInsets.symmetric(
mainAxisAlignment: vertical: 6.0),
MainAxisAlignment.center, child: Container(
children: [ width: playerColWidth *
const SizedBox( (playerCount *
height: 5, 0.2), // Adjust width based on amount of players
), decoration: BoxDecoration(
Container( color: saidCabo
padding: const EdgeInsets.symmetric( ? CustomTheme.buttonBackgroundColor
horizontal: 6, vertical: 2), : CupertinoColors.transparent,
decoration: BoxDecoration( borderRadius: BorderRadius.circular(5),
color: update <= 0 ),
? CustomTheme.pointLossColor child: Column(
: CustomTheme.pointGainColor, mainAxisAlignment:
borderRadius: MainAxisAlignment.center,
BorderRadius.circular(8), children: [
const SizedBox(
height: 5,
), ),
child: Text( Container(
'${update >= 0 ? '+' : ''}$update', padding: const EdgeInsets.symmetric(
style: const TextStyle( horizontal: 6, vertical: 2),
color: CupertinoColors.white, decoration: BoxDecoration(
fontWeight: FontWeight.bold, color: update <= 0
? CustomTheme.pointLossColor
: CustomTheme.pointGainColor,
borderRadius:
BorderRadius.circular(6),
),
child: Text(
'${update >= 0 ? '+' : ''}$update',
style: const TextStyle(
color: CupertinoColors.white,
fontWeight: FontWeight.bold,
),
), ),
), ),
), const SizedBox(height: 4),
const SizedBox(height: 4), Text(
Container(
padding: const EdgeInsets.symmetric(
horizontal: 4, vertical: 2),
decoration: BoxDecoration(
color: saidCabo
? const Color(0xFF505050)
: CupertinoColors.transparent,
borderRadius:
BorderRadius.circular(5),
),
child: Text(
'$score', '$score',
style: TextStyle( style: TextStyle(
color: CustomTheme.white, color: CustomTheme.white,
@@ -143,11 +145,11 @@ class _PointsViewState extends State<PointsView> {
: FontWeight.normal, : FontWeight.normal,
), ),
), ),
), ],
], ),
), ),
), ),
); ));
}), }),
], ],
); );

View File

@@ -2,7 +2,7 @@ name: cabo_counter
description: "Mobile app for the card game Cabo" description: "Mobile app for the card game Cabo"
publish_to: 'none' publish_to: 'none'
version: 0.5.5+634 version: 0.5.5+636
environment: environment:
sdk: ^3.5.4 sdk: ^3.5.4