From 332cc3ddf86c3acf8fcf8bda70e1221433cdf6e3 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 29 Jan 2026 18:08:44 +0100 Subject: [PATCH] Extract language code as variable --- lib/widgets/nutrition/forms.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/widgets/nutrition/forms.dart b/lib/widgets/nutrition/forms.dart index 39795233..cd33bff3 100644 --- a/lib/widgets/nutrition/forms.dart +++ b/lib/widgets/nutrition/forms.dart @@ -1,13 +1,13 @@ /* * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 wger Team + * Copyright (c) 2020 - 2026 wger Team * * wger Workout Manager is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * wger Workout Manager is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. @@ -227,8 +227,9 @@ class IngredientFormState extends State { @override Widget build(BuildContext context) { - final dateFormat = DateFormat.yMd(Localizations.localeOf(context).languageCode).add_Hm(); - final timeFormat = DateFormat.Hm(Localizations.localeOf(context).languageCode); + final languageCode = Localizations.localeOf(context).languageCode; + final dateFormat = DateFormat.yMd(languageCode).add_Hm(); + final timeFormat = DateFormat.Hm(languageCode); if (_dateController.text.isEmpty) { _dateController.text = dateFormat.format(DateTime.now());