mirror of
https://github.com/wger-project/flutter.git
synced 2026-12-03 10:33:54 +01:00
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:
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user