mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.5 KiB
67 lines
1.5 KiB
3 months ago
|
enum CuisineFilter {
|
||
|
italian,
|
||
|
mexican,
|
||
|
american,
|
||
|
french,
|
||
|
japanese,
|
||
|
chinese,
|
||
|
indian,
|
||
|
greek,
|
||
|
moroccan,
|
||
|
ethiopian,
|
||
|
southAfrican,
|
||
|
}
|
||
|
|
||
|
enum BasicIngredientsFilter {
|
||
|
oil,
|
||
|
butter,
|
||
|
flour,
|
||
|
salt,
|
||
|
pepper,
|
||
|
sugar,
|
||
|
milk,
|
||
|
vinegar,
|
||
|
}
|
||
|
|
||
|
enum DietaryRestrictionsFilter {
|
||
|
vegan,
|
||
|
vegetarian,
|
||
|
lactoseIntolerant,
|
||
|
kosher,
|
||
|
// keto,
|
||
|
wheatAllergies,
|
||
|
nutAllergies,
|
||
|
fishAllergies,
|
||
|
soyAllergies,
|
||
|
}
|
||
|
|
||
|
String dietaryRestrictionReadable(DietaryRestrictionsFilter filter) {
|
||
|
return switch (filter) {
|
||
|
DietaryRestrictionsFilter.vegan => 'vegan',
|
||
|
DietaryRestrictionsFilter.vegetarian => 'vegetarian',
|
||
|
DietaryRestrictionsFilter.lactoseIntolerant => 'dairy free',
|
||
|
DietaryRestrictionsFilter.kosher => 'kosher',
|
||
|
// DietaryRestrictionsFilter.keto => 'low carb',
|
||
|
DietaryRestrictionsFilter.wheatAllergies => 'wheat allergy',
|
||
|
DietaryRestrictionsFilter.nutAllergies => 'nut allergy',
|
||
|
DietaryRestrictionsFilter.fishAllergies => 'fish allergy',
|
||
|
DietaryRestrictionsFilter.soyAllergies => 'soy allergy',
|
||
|
};
|
||
|
}
|
||
|
|
||
|
String cuisineReadable(CuisineFilter filter) {
|
||
|
return switch (filter) {
|
||
|
CuisineFilter.italian => 'Italian',
|
||
|
CuisineFilter.mexican => 'Mexican',
|
||
|
CuisineFilter.american => 'American',
|
||
|
CuisineFilter.french => 'French',
|
||
|
CuisineFilter.japanese => 'Japanese',
|
||
|
CuisineFilter.chinese => 'Chinese',
|
||
|
CuisineFilter.indian => 'Indian',
|
||
|
CuisineFilter.ethiopian => 'Ethiopian',
|
||
|
CuisineFilter.moroccan => 'Moroccan',
|
||
|
CuisineFilter.greek => 'Greek',
|
||
|
CuisineFilter.southAfrican => 'South African',
|
||
|
};
|
||
|
}
|