create recipe page edited

This commit is contained in:
SomnusVeritas
2023-10-02 19:57:43 +02:00
parent 2e35cd1f9d
commit bd546ffaaf
2 changed files with 54 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
import 'package:rezepte/models/recipe.dart';
class DifficultyDropdown extends StatelessWidget {
const DifficultyDropdown({super.key});
@override
Widget build(BuildContext context) {
List<DropdownMenuEntry> dropdownMenuEntryList = List.generate(
Difficulty.values.length,
(index) => _toDropdownMenuEntry(
index, Difficulty.values.elementAt(index).name));
return DropdownMenu(
dropdownMenuEntries: dropdownMenuEntryList,
);
}
DropdownMenuEntry _toDropdownMenuEntry(int index, String text) =>
DropdownMenuEntry(value: index, label: text);
}