You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the great tutorial
what if ingredients are objects not string
I made ingredients data model
and in the food data model I defined
List ingredients;
FoodModel.fromMap(Map<String, dynamic> data){
id = data[ID];
name = data[NAME];
categories = data[CATEGORIES];
}
Map<String, dynamic> toMap() {
return {
ID: id,
NAME:name,
CATEGORIES: categories,
};
}
I defined & filled a temporary list
List ingredientsTempList;
then I put values to food field
food.ingredients = ingredientsTempList;
I found values in food.ingredients ex: print(food.ingredients[0].name)
when i save the product to firestore the screen hold, it doesn't save waiting for something?
The text was updated successfully, but these errors were encountered:
Thank you for the great tutorial
what if ingredients are objects not string
I made ingredients data model
and in the food data model I defined
List ingredients;
FoodModel.fromMap(Map<String, dynamic> data){
id = data[ID];
name = data[NAME];
categories = data[CATEGORIES];
}
Map<String, dynamic> toMap() {
return {
ID: id,
NAME:name,
CATEGORIES: categories,
};
}
I defined & filled a temporary list
List ingredientsTempList;
then I put values to food field
food.ingredients = ingredientsTempList;
I found values in food.ingredients ex: print(food.ingredients[0].name)
when i save the product to firestore the screen hold, it doesn't save waiting for something?
The text was updated successfully, but these errors were encountered: