From 6ab9cef5d8464e5a8ec710bdbd3dc4bd91babaa7 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 18 Feb 2021 23:16:32 +0100 Subject: [PATCH] Right align calendar button as well --- lib/locale/locales.dart | 16 ++++++++++++++++ lib/widgets/dashboard/calendar.dart | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/lib/locale/locales.dart b/lib/locale/locales.dart index cfcba218..c4919333 100644 --- a/lib/locale/locales.dart +++ b/lib/locale/locales.dart @@ -67,6 +67,14 @@ class AppLocalizations { ); } + String get workoutSession { + return Intl.message( + 'Workout session', + name: 'workoutSession', + desc: 'A logged workout session', + ); + } + String get newDay { return Intl.message( 'New day', @@ -155,6 +163,14 @@ class AppLocalizations { ); } + String get nutritionalDiary { + return Intl.message( + 'Nutritional diary', + name: 'nutritionalDiary', + desc: 'The nutritional diary for a plan', + ); + } + String get nutritionalPlans { return Intl.message( 'Nutritional plans', diff --git a/lib/widgets/dashboard/calendar.dart b/lib/widgets/dashboard/calendar.dart index 3b7508ed..5b7d7a09 100644 --- a/lib/widgets/dashboard/calendar.dart +++ b/lib/widgets/dashboard/calendar.dart @@ -354,6 +354,22 @@ class _DashboardCalendarWidgetState extends State } Widget _buildButtons() { + return Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + TextButton( + child: Text('Go to today'), + onPressed: () async { + final today = DateTime.now(); + _calendarController.setSelectedDay( + DateTime(today.year, today.month, today.day), + runCallback: true, + ); + }, + ), + ], + ); + return Column( children: [ TextButton(