From 3f4b5bf6909f794aec732d28974b8659ff6ae43d Mon Sep 17 00:00:00 2001 From: Gustl22 Date: Sat, 5 Oct 2024 22:57:15 +0200 Subject: [PATCH] feat: Adapt bout display layout --- .../screens/display/bout/bout_actions.dart | 2 +- .../screens/display/bout/bout_display.dart | 19 ++++++++++++------- .../display/bout/technical_points.dart | 15 +++++++++------ .../lib/view/screens/display/common.dart | 2 +- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/wrestling_scoreboard_client/lib/view/screens/display/bout/bout_actions.dart b/wrestling_scoreboard_client/lib/view/screens/display/bout/bout_actions.dart index d5772e20..d2e4c889 100644 --- a/wrestling_scoreboard_client/lib/view/screens/display/bout/bout_actions.dart +++ b/wrestling_scoreboard_client/lib/view/screens/display/bout/bout_actions.dart @@ -70,7 +70,7 @@ class ActionsWidget extends ConsumerWidget { color: color, child: ScaledText( action.actionValue, - fontSize: 22, + fontSize: 28, softWrap: false, ), ), diff --git a/wrestling_scoreboard_client/lib/view/screens/display/bout/bout_display.dart b/wrestling_scoreboard_client/lib/view/screens/display/bout/bout_display.dart index 4cd5dd71..3ef06813 100644 --- a/wrestling_scoreboard_client/lib/view/screens/display/bout/bout_display.dart +++ b/wrestling_scoreboard_client/lib/view/screens/display/bout/bout_display.dart @@ -271,17 +271,19 @@ class BoutState extends ConsumerState { child: ScaledText( pStatus?.fullName(context) ?? localizations.participantVacant, color: pStatus == null ? Colors.white30 : Colors.white, - fontSize: 28, + fontSize: 40, minFontSize: 20, ), )), SizedBox( child: Center( child: ScaledText( - (pStatus?.participation.weight != null - ? '${pStatus?.participation.weight!.toStringAsFixed(1)} $weightUnit' - : AppLocalizations.of(context)!.participantUnknownWeight), - color: pStatus?.participation.weight == null ? Colors.white30 : Colors.white))), + (pStatus?.participation.weight != null + ? '${pStatus?.participation.weight!.toStringAsFixed(1)} $weightUnit' + : AppLocalizations.of(context)!.participantUnknownWeight), + color: pStatus?.participation.weight == null ? Colors.white30 : Colors.white, + fontSize: 22, + ))), ], ), ); @@ -299,7 +301,7 @@ class BoutState extends ConsumerState { child: Center( child: ScaledText( pStatus!.classificationPoints.toString(), - fontSize: 46, + fontSize: 54, minFontSize: 30, ), ), @@ -486,6 +488,7 @@ class BoutState extends ConsumerState { child: Center( child: ScaledText( '${AppLocalizations.of(context)!.bout} ${widget.boutIndex + 1}', + fontSize: 22, minFontSize: 10, ))), ]), @@ -493,12 +496,14 @@ class BoutState extends ConsumerState { Center( child: ScaledText( '${bout.weightClass!.style.localize(context)}', + fontSize: 22, minFontSize: 10, )), if (bout.weightClass != null) Center( child: ScaledText( bout.weightClass!.name, + fontSize: 26, minFontSize: 10, )), ])), @@ -518,7 +523,7 @@ class BoutState extends ConsumerState { child: TimeDisplay( stopwatch, stopwatchColor, - fontSize: 100, + fontSize: 128, maxDuration: boutConfig.totalPeriodDuration, ), ), diff --git a/wrestling_scoreboard_client/lib/view/screens/display/bout/technical_points.dart b/wrestling_scoreboard_client/lib/view/screens/display/bout/technical_points.dart index 0e400e53..244f2378 100644 --- a/wrestling_scoreboard_client/lib/view/screens/display/bout/technical_points.dart +++ b/wrestling_scoreboard_client/lib/view/screens/display/bout/technical_points.dart @@ -15,6 +15,7 @@ class TechnicalPoints extends StatelessWidget { final ParticipantStateModel pStatusModel; final Bout bout; final BoutConfig boutConfig; + final timerFontSize = 32.0; const TechnicalPoints({ required this.role, @@ -32,6 +33,7 @@ class TechnicalPoints extends StatelessWidget { color: role.color(), height: cellHeight, child: Column( + mainAxisSize: MainAxisSize.max, children: [ Expanded( flex: 70, @@ -41,33 +43,34 @@ class TechnicalPoints extends StatelessWidget { return FittedText( (ParticipantState.getTechnicalPoints(actions, role)).toString(), softWrap: false, + style: const TextStyle(height: 1.2), ); }, ), ), if (pStatusModel.activityStopwatch != null) Expanded( - flex: 40, + flex: 30, child: Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - ScaledText(AppLocalizations.of(context)!.activityTimeAbbr, fontSize: 18), + ScaledText(AppLocalizations.of(context)!.activityTimeAbbr, fontSize: timerFontSize), TimeDisplay( pStatusModel.activityStopwatch!, white, - fontSize: 18, + fontSize: timerFontSize, maxDuration: boutConfig.activityDuration, ) ])), if (pStatusModel.isInjury) Expanded( - flex: 40, + flex: 30, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - ScaledText(AppLocalizations.of(context)!.injuryTimeShort, fontSize: 18), + ScaledText(AppLocalizations.of(context)!.injuryTimeShort, fontSize: timerFontSize), TimeDisplay( pStatusModel.injuryStopwatch, white, - fontSize: 18, + fontSize: timerFontSize, maxDuration: boutConfig.injuryDuration, ) ], diff --git a/wrestling_scoreboard_client/lib/view/screens/display/common.dart b/wrestling_scoreboard_client/lib/view/screens/display/common.dart index 7a68e563..6703c787 100644 --- a/wrestling_scoreboard_client/lib/view/screens/display/common.dart +++ b/wrestling_scoreboard_client/lib/view/screens/display/common.dart @@ -30,7 +30,7 @@ class ClassificationPointsDisplay extends ConsumerWidget { builder: (context, participationStates) { return ScaledText( TeamMatch.getClassificationPoints(participationStates).toString(), - fontSize: 28, + fontSize: 36, minFontSize: 16, softWrap: false, );