How to setup Firebase for Flutter 2024 | Connect with Android, iOS & Web | Flutter with Firebase

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back let's set up our first Firebase project for our flutter application before starting I have created a video on what is Firebase and how it can be useful with flutter I have put a link in the description go and watch the video if you are interested now coming back to the main content I have created a sample flutter project that we would be connecting with fire go to console add a project give it a name and after after creating a name continue here you can enable or disable uh analytics Services we won't need it for now so create project Firebase is allocating resources to our project and now continue to our project this is the main dashboard screen of our project on the top we have the Android iOS and flutter web icons click on the Android Register App here you need to add the application ID in the app level build. GLE file copy it and paste it in the text field after uh that register your app and now you need to download Google services. Json file copy the file and put it in the app level directory after that go back and press on next here uh you have these lines copy the line and add this line in the project level build. GLE file here in the dependency section at this line you need to modify the line a bit change it accordingly in some newer versions of flutter these lines are not added by default so you may need to copy it from here and then you can add the dependency line here after that uh come down and copy the other line put it in the app level build. GLE file this time in the app L build. GLE file you have the plugin section section here add this line after that go to Firebase uh copy the other line and put it in the dependency section now your Android app has been configured for the Firebase project now uh press on add app and create one for iOS here you have to put the app bundle identifier here go to the iOS directory and now to this Runner file and and open the project file here you can find the bundle identifier copy it from here and paste it in the Firebase now register the app download the file copy and paste it in the runner directory inside the iOS folder then click on the next next and next continue to console your IOS app has been configured as well now we can move to the the setting up the flutter web here uh specify a nickname and register the app here you can check or uncheck the hosting service we don't need it for now you have been given some credentials here Firebase configurations go to the Firebase core plugin download it from Pub Dave and add it in the pope.l file under the dependencies press control s to install it now go to the main file here you have to add these lines which is Firebase from the fireb score plugin do initialize app here for web you have to specify these options and these credentials have been provided by Firebase copy these credentials from Firebase and put it in those Firebase options so uh replace these uh demic credentials with the real ones okay uh and now your uh Firebase project has been set up it's been connected with flutter uh you have to add some lens here uh if our platform is web so uh we need to pass these options so this line will only be executed when our platform is web means we are working on a web application if it's not web it's either Android or iOS we just need to execute the line Firebase do initialize app so uh that that works for our uh Firebase project uh now continue console our application has been added here we have to add some more lines which is widgets flter binding. insure initialized which ensures that the bindings with the native platform has been created properly and put await before the Firebase initialize app and down there as well so now we have created our first firal project and we have connected it with our Android iOS and web application that's it for today video uh see you in the next video goodbye
Info
Channel: CodeWorm
Views: 1,806
Rating: undefined out of 5
Keywords: flutter, firebase, firebasetutorial, flutterfirebase, setupfirebase
Id: FYcYVkTowRs
Channel Id: undefined
Length: 4min 53sec (293 seconds)
Published: Sun Feb 25 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.