feat: enhance admin and profile repositories with token handling; update dropdown initial values in various screens
This commit is contained in:
@@ -17,7 +17,7 @@ class RecipeRepository {
|
||||
throw const ApiException(
|
||||
type: ApiErrorType.unknown, message: 'Ogiltigt svar från servern.');
|
||||
}
|
||||
return (data as List)
|
||||
return data
|
||||
.map((e) => Recipe.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
} on ApiException {
|
||||
|
||||
@@ -399,7 +399,7 @@ class _RecipeEditScreenState extends ConsumerState<RecipeEditScreen> {
|
||||
],
|
||||
),
|
||||
DropdownButtonFormField<int>(
|
||||
value: ingredient.productId,
|
||||
initialValue: ingredient.productId,
|
||||
isExpanded: true,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Produkt *',
|
||||
@@ -461,7 +461,7 @@ class _RecipeEditScreenState extends ConsumerState<RecipeEditScreen> {
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: DropdownButtonFormField<String>(
|
||||
value: ingredient.unit.trim().isEmpty ? null : ingredient.unit,
|
||||
initialValue: ingredient.unit.trim().isEmpty ? null : ingredient.unit,
|
||||
isExpanded: true,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Enhet *',
|
||||
|
||||
Reference in New Issue
Block a user