create recipe page edited
This commit is contained in:
21
lib/widgets/difficulty_dropdown.dart
Normal file
21
lib/widgets/difficulty_dropdown.dart
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user