feat: enhance admin and profile repositories with token handling; update dropdown initial values in various screens
This commit is contained in:
@@ -114,19 +114,19 @@ class _MealPlanScreenState extends ConsumerState<MealPlanScreen> {
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
OutlinedButton.icon(
|
||||
onPressed: () => ref.read(mealPlanWeekOffsetProvider.notifier).state--,
|
||||
onPressed: () => ref.read(mealPlanWeekOffsetProvider.notifier).decrement(),
|
||||
icon: const Icon(Icons.chevron_left),
|
||||
label: Text(l10n.mealPlanWeekPrevious),
|
||||
),
|
||||
Chip(label: Text(weekLabel)),
|
||||
OutlinedButton.icon(
|
||||
onPressed: () => ref.read(mealPlanWeekOffsetProvider.notifier).state++,
|
||||
onPressed: () => ref.read(mealPlanWeekOffsetProvider.notifier).increment(),
|
||||
icon: const Icon(Icons.chevron_right),
|
||||
label: Text(l10n.mealPlanWeekNext),
|
||||
),
|
||||
if (ref.watch(mealPlanWeekOffsetProvider) != 0)
|
||||
TextButton(
|
||||
onPressed: () => ref.read(mealPlanWeekOffsetProvider.notifier).state = 0,
|
||||
onPressed: () => ref.read(mealPlanWeekOffsetProvider.notifier).reset(),
|
||||
child: Text(l10n.mealPlanWeekCurrent),
|
||||
),
|
||||
],
|
||||
@@ -203,7 +203,7 @@ class _DayCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
DropdownButtonFormField<String>(
|
||||
value: selectedValue,
|
||||
initialValue: selectedValue,
|
||||
isExpanded: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.mealPlanSelectRecipe,
|
||||
@@ -248,7 +248,7 @@ class _DayCard extends StatelessWidget {
|
||||
SizedBox(
|
||||
width: 220,
|
||||
child: DropdownButtonFormField<int>(
|
||||
value: currentServings,
|
||||
initialValue: currentServings,
|
||||
decoration: InputDecoration(
|
||||
labelText: l10n.mealPlanServingsLabel,
|
||||
border: const OutlineInputBorder(),
|
||||
|
||||
Reference in New Issue
Block a user