Skip to content

Commit

Permalink
feat: Adapt bout display layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustl22 committed Oct 5, 2024
1 parent 06bfb4d commit 3f4b5bf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ActionsWidget extends ConsumerWidget {
color: color,
child: ScaledText(
action.actionValue,
fontSize: 22,
fontSize: 28,
softWrap: false,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,19 @@ class BoutState extends ConsumerState<BoutScreen> {
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,
))),
],
),
);
Expand All @@ -299,7 +301,7 @@ class BoutState extends ConsumerState<BoutScreen> {
child: Center(
child: ScaledText(
pStatus!.classificationPoints.toString(),
fontSize: 46,
fontSize: 54,
minFontSize: 30,
),
),
Expand Down Expand Up @@ -486,19 +488,22 @@ class BoutState extends ConsumerState<BoutScreen> {
child: Center(
child: ScaledText(
'${AppLocalizations.of(context)!.bout} ${widget.boutIndex + 1}',
fontSize: 22,
minFontSize: 10,
))),
]),
if (bout.weightClass != null)
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,
)),
])),
Expand All @@ -518,7 +523,7 @@ class BoutState extends ConsumerState<BoutScreen> {
child: TimeDisplay(
stopwatch,
stopwatchColor,
fontSize: 100,
fontSize: 128,
maxDuration: boutConfig.totalPeriodDuration,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -32,6 +33,7 @@ class TechnicalPoints extends StatelessWidget {
color: role.color(),
height: cellHeight,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(
flex: 70,
Expand All @@ -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,
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down

0 comments on commit 3f4b5bf

Please sign in to comment.