How to Use Firebase in Flutter - Part 3 (Uploading/Updating Data)

preview_player
Показать описание
In part 1, I covered Firebase email authentication. Part 2 walked you through the process of retrieving documents from FireStore and displaying that data in a ListView. In part 3, we will create a Food form where we can create new food objects and update existing food objects in the Firestore backend.

This video assumes that you have seen part 1 and part 2.

00:00 - Intro
00:45 - Creating upload model constructor
01:51 - Creating the upload form
30:23 - Getting images from the file system
34:30 - Deciding to create or update object
39:05 - Saving and validating the data
43:35 - Uploading images
45:54 - Getting the image file path
47:25 - Generating unique IDs
50:58 - Getting the remote image URL
51:41 - Uploading/Updating images
1:00:01 - Testing and debugging errors

Рекомендации по теме
Комментарии
Автор

Great video!
Just some mentions for newcomers:
1)Always use a Cashed network image plugin to save firebase bandwidth.
2)Never try to upload something on firebase without first checking for connection status. Error handling can be a mess with the firebase API.
3)if you use streams to show firebase data, never forgot to cancel, as it may cost unnecessary callbacks and money.

All the best!

storylineteam
Автор

Finally I finished this without error, so many changes with the current Flutter, one more video to go, thanks for the tutorial

hitomiadachi
Автор

this series slaps so hard!! well done!!

sirshredderkyle
Автор

I can't thank you enough sir, But these videos of yours are saved me... I really really mean it. Thank you

mayankshukla
Автор

Bro thank you so much, you just saved my school project all of your video are high quality and everything is working like a charm <3;

darkman
Автор

Amazing video man. Very powerful stuff with firebase. Keep up the good work.

MahbuburRahman-ucnp
Автор

Amazing tutorial ! it's very very thorough ! thanks for making!

ankitchawla
Автор

Another fantastic tutorial! Thank you for your depth of coverage of this material.👏🏾👏🏾👏🏾

curiousnrd
Автор

Thanks you very much for this tutorial.. Please can you do a tutorial on authentication role management with firestore that a user sees different screen and admin also sees different screen... Thanks very much

benjaminashie
Автор

@The Flutter Factory in which tutorial u taught provider, plz mention i cant find.

anastahseen
Автор

Dear Sir,

Thank you very much for the great tutorial for flutter firestore.
I have a big question for you to help me to fix my project ….
" Everyone can update all pics & texts in every listview if Login. How can do limit to update them only my own account?
I mean, if I created 4 foods, I can update just only 4 foods of me in the app???

Thanks again & Regards,

tonaor
Автор

Hi curry a big fan, can we add the same features into the admin app ?? if yes how. i couldn't find many resources so if you make a video on this i guess it will be really helpful for lots of flutter enthusiasts

nischaljoshi
Автор

Hi Curry,
As always thank you. Tutorial is just great.
Need to say have problem with this line:

When clicking "Create new food" button below error appears:
"The getter 'iterator' was called on null."
When I'm commenting this line, everything works fine (except the ingredients aren't visible). Thank you in advance for a hint :).

mateolas
Автор

How to do this separate application for uploading foods and rates this is my big dout ever... Can u made separate application for those admin and user this is very useful thanks in advance cheers 😎

allintamilvideos
Автор

Great tutorial, thank you, can you just add the link of previous and next video?

hadikngaming
Автор

Hello, if I want to add gallery images( more than one images) in the "add image". What is the right code please.

esirioneyibo
Автор

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<IngredientsModel> 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<IngredientsModel> ingredientsTempList
;

then I put values to food
field
food.ingredients = ingredientsTempList
;

I found values in food.ingredients ex:

when i save the product to firestore the screen hold, it doesn't save waiting for something??

Tehutiedu
Автор

hello I make a mistake here .. do you know why? if (foodNotifier.currentFood != null) {
_currentFood = foodNotifier.currentFood;
} else {
_currentFood = Food();
}

Bathusaix
Автор

I am getting this error. Boolean is called on null when i try to add new food

nischaljoshi
Автор

The getter 'name' was called on null.
Receiver: null
Tried calling: name

divyanshv