Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Teifun2 committed Jan 31, 2021
2 parents 5ebc3b3 + fa00403 commit 2a23c9c
Show file tree
Hide file tree
Showing 17 changed files with 1,540 additions and 106 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ It works best with an Nextcloud installation >= 19 and a Cookbook plugin version
Current Features:
- View all recipes by Category
- Search Recipes by Name
- Recipe Editing

Planned Features:
- Recipe Editing *
- Recipe Creating
- Recipe Creating *
- Recipe Import
- Darkmode
- Offline Usage (Caching)
Expand All @@ -34,7 +34,8 @@ https://www.transifex.com/nextcloud/nextcloud/cookbook_flutter/

<img src="https://user-images.githubusercontent.com/7461832/106359784-0c7e5100-6315-11eb-809b-975ad55dd3eb.png" alt="Login Screen" width="300px" /> <img src="https://user-images.githubusercontent.com/7461832/106359789-0e481480-6315-11eb-9631-c5d919dfe197.png" alt="Categories" width="300px" />
<img src="https://user-images.githubusercontent.com/7461832/106359788-0daf7e00-6315-11eb-8604-7abbc541e344.png" alt="Search" width="300px" /> <img src="https://user-images.githubusercontent.com/7461832/106359787-0daf7e00-6315-11eb-88a4-b305b796d512.png" alt="Category Recipes" width="300px" />
<img src="https://user-images.githubusercontent.com/7461832/106359786-0d16e780-6315-11eb-830a-3454551e3a07.png" alt="Recipe" width="300px" /> <img src="https://user-images.githubusercontent.com/7461832/106359785-0d16e780-6315-11eb-9099-0c33aa8943be.png" alt="Recipe Details" width="300px" />
<img src="https://user-images.githubusercontent.com/7461832/106396792-8a705400-640a-11eb-9d81-8ca421a689f2.png" alt="Recipe" width="300px" /> <img src="https://user-images.githubusercontent.com/7461832/106359785-0d16e780-6315-11eb-9099-0c33aa8943be.png" alt="Recipe Details" width="300px" />
<img src="https://user-images.githubusercontent.com/7461832/106396793-8c3a1780-640a-11eb-9324-7a9d26205814.png" alt="Recipe Edit 1" width="300px" /> <img src="https://user-images.githubusercontent.com/7461832/106396794-8c3a1780-640a-11eb-8d64-5eb4fc90faa9.png" alt="Recipe Edit 2" width="300px" />



Expand Down
6 changes: 6 additions & 0 deletions assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,14 @@
"recipe": {
"title": "Recipe:",
"fields": {
"name": "Recipe Name:",
"description": "Recipe Description:",
"keywords": "Keywords:",
"category": "Category:",
"servings": "Servings:",
"source": "Source:",
"source_button": "Source",
"image": "Image:",
"time": {
"prep": "Preparation time:",
"cook": "Cooking time:",
Expand All @@ -76,6 +81,7 @@
},
"recipe_edit": {
"title": "Edit Recipe",
"button": "Update Recipe",
"errors": {
"update_failed": "Update Failed {error_msg}"
}
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/16.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Editing Recipes
7 changes: 4 additions & 3 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ Current Features:

View all recipes by Category
Search Recipes by Name
Recipe Editing


Planned Features:

Recipe Editing *
Recipe Creating
Recipe Import
Darkmode
Darkmode *
Offline Usage (Caching)
* Currently worked on!

* Currently worked on!

Translation
To help the translation of the app visit: https://www.transifex.com/nextcloud/nextcloud/cookbook_flutter/
Binary file modified fastlane/metadata/android/en-US/images/phoneScreenshots/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 90 additions & 48 deletions lib/src/models/recipe.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Recipe extends Equatable {
final String keywords;
final String image;
final String url;
final Map<String, dynamic> remainingData;

const Recipe._(
this.id,
Expand All @@ -35,7 +36,8 @@ class Recipe extends Equatable {
this.totalTime,
this.keywords,
this.image,
this.url);
this.url,
this.remainingData);

factory Recipe(String jsonString) {
Map<String, dynamic> data = json.decode(jsonString);
Expand Down Expand Up @@ -65,41 +67,69 @@ class Recipe extends Equatable {
String image = data["image"];
String url = data["url"];

data.remove("id");
data.remove("name");
data.remove("imageUrl");
data.remove("recipeCategory");
data.remove("description");
data.remove("recipeIngredient");
data.remove("recipeInstructions");
data.remove("tool");
data.remove("recipeYield");
data.remove("prepTime");
data.remove("cookTime");
data.remove("totalTime");
data.remove("keywords");
data.remove("image");
data.remove("url");

data.remove("dateModified");

return Recipe._(
id,
name,
imageUrl,
recipeCategory,
description,
recipeIngredient,
recipeInstructions,
tool,
recipeYield,
prepTime,
cookTime,
totalTime,
keywords,
image,
url);
id,
name,
imageUrl,
recipeCategory,
description,
recipeIngredient,
recipeInstructions,
tool,
recipeYield,
prepTime,
cookTime,
totalTime,
keywords,
image,
url,
data,
);
}

Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'imageUrl': imageUrl,
'recipeCategory': recipeCategory,
'description': description,
'recipeIngredient': recipeIngredient,
'recipeInstructions': recipeInstructions,
'tool': tool,
'recipeYield': recipeYield,
'prepTime': prepTime,
'cookTime': cookTime,
'totalTime': totalTime,
'keywords': keywords,
'image': image,
'url': url
};
String toJson() {
Map<String, dynamic> updatedData = {
'id': id,
'name': name,
'imageUrl': imageUrl,
'recipeCategory': recipeCategory,
'description': description,
'recipeIngredient': recipeIngredient,
'recipeInstructions': recipeInstructions,
'tool': tool,
'recipeYield': recipeYield,
'prepTime': _durationToIso(prepTime),
'cookTime': _durationToIso(cookTime),
'totalTime': _durationToIso(totalTime),
'keywords': keywords,
'image': image,
'url': url,
'dateModified': DateTime.now().toIso8601String()
};

// Add all the data points that are not handled by the app!
remainingData.addAll(updatedData);

return jsonEncode(remainingData);
}

MutableRecipe toMutableRecipe() {
MutableRecipe mutableRecipe = MutableRecipe();
Expand All @@ -111,16 +141,25 @@ class Recipe extends Equatable {
mutableRecipe.description = this.description;
mutableRecipe.recipeIngredient = this.recipeIngredient;
mutableRecipe.recipeInstructions = this.recipeInstructions;
mutableRecipe.tool = this.tool;
mutableRecipe.recipeYield = this.recipeYield;
mutableRecipe.prepTime = this.prepTime;
mutableRecipe.cookTime = this.cookTime;
mutableRecipe.totalTime = this.totalTime;
mutableRecipe.keywords = this.keywords;
mutableRecipe.image = this.image;
mutableRecipe.url = this.url;
mutableRecipe.remainingData = this.remainingData;

return mutableRecipe;
}

@override
List<Object> get props => [id];

String _durationToIso(Duration duration) {
return "PT${duration.inHours}H${duration.inMinutes % 60}M";
}
}

class MutableRecipe {
Expand All @@ -139,23 +178,26 @@ class MutableRecipe {
String keywords;
String image;
String url;
Map<String, dynamic> remainingData;

Recipe toRecipe() {
return Recipe._(
id,
name,
imageUrl,
recipeCategory,
description,
recipeIngredient,
recipeInstructions,
tool,
recipeYield,
prepTime,
cookTime,
totalTime,
keywords,
image,
url);
id,
name,
imageUrl,
recipeCategory,
description,
recipeIngredient,
recipeInstructions,
tool,
recipeYield,
prepTime,
cookTime,
totalTime,
keywords,
image,
url,
remainingData,
);
}
}
Loading

0 comments on commit 2a23c9c

Please sign in to comment.