mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Consistently show the day and type name
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user