Consistently show the day and type name

This commit is contained in:
Roland Geider
2025-10-16 23:48:15 +02:00
parent 1f6d22d85a
commit b0d1bce9aa
3 changed files with 3 additions and 3 deletions

View File

@@ -124,7 +124,7 @@ class Day {
bool get isSpecialType => type != DayType.custom;
String typeLabel() => isSpecialType ? '\n(${type.name.toUpperCase()})' : '';
String get nameWithType => isSpecialType ? '${type.name.toUpperCase()} - $name' : name;
// Boilerplate
factory Day.fromJson(Map<String, dynamic> json) => _$DayFromJson(json);

View File

@@ -130,7 +130,7 @@ class DetailContentWidget extends StatelessWidget {
child: Text(
dayData.day == null || dayData.day!.isRest
? AppLocalizations.of(context).restDay
: dayData.day!.name,
: dayData.day!.nameWithType,
style: const TextStyle(fontWeight: FontWeight.bold),
overflow: TextOverflow.ellipsis,
),

View File

@@ -150,7 +150,7 @@ class DayHeader extends StatelessWidget {
tileColor: Theme.of(context).focusColor,
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
title: Text(
'${_dayData.day!.name}${_dayData.day!.typeLabel()}',
_dayData.day!.nameWithType,
style: Theme.of(context).textTheme.headlineSmall,
overflow: TextOverflow.ellipsis,
),