Show the start and end dates for the current routine in the dashboard

The date in which the routine was created is not so important anymore
This commit is contained in:
Roland Geider
2025-03-17 21:03:12 +01:00
parent 58a641d298
commit 1c2e988c82
2 changed files with 7 additions and 4 deletions

View File

@@ -461,6 +461,8 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
@override
Widget build(BuildContext context) {
final dateFormat = DateFormat.yMd(Localizations.localeOf(context).languageCode);
return Card(
child: Column(
children: [
@@ -471,8 +473,7 @@ class _DashboardWorkoutWidgetState extends State<DashboardWorkoutWidget> {
),
subtitle: Text(
_hasContent
? DateFormat.yMd(Localizations.localeOf(context).languageCode)
.format(_routine!.created)
? '${dateFormat.format(_routine!.start)} - ${dateFormat.format(_routine!.end)}'
: '',
),
leading: Icon(

View File

@@ -38,6 +38,8 @@ class _RoutinesListState extends State<RoutinesList> {
@override
Widget build(BuildContext context) {
final dateFormat = DateFormat.yMd(Localizations.localeOf(context).languageCode);
return RefreshIndicator(
onRefresh: () => widget._routineProvider.fetchAndSetAllPlansSparse(),
child: widget._routineProvider.items.isEmpty
@@ -71,8 +73,8 @@ class _RoutinesListState extends State<RoutinesList> {
},
title: Text(currentRoutine.name),
subtitle: Text(
'${DateFormat.yMd(Localizations.localeOf(context).languageCode).format(currentRoutine.start)}'
' - ${DateFormat.yMd(Localizations.localeOf(context).languageCode).format(currentRoutine.end)}',
'${dateFormat.format(currentRoutine.start)}'
' - ${dateFormat.format(currentRoutine.end)}',
),
trailing: Row(
mainAxisSize: MainAxisSize.min,