Add Firebase to your Flutter app: The fast way

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[MUSIC PLAYING] ALEXANDER NOHE: Hey, everyone. The Firebase Console has a bunch of different options for adding support to Android, web, and iOS apps. How can we quickly add Firebase to all of the supported Flutter platforms? We'll use the Flutterfire CLI. Rather than having to go to the Firebase Console to get started, you can call a single command on your development machine to get up and running fast. Let's hit it up for use together. To get started, make sure that you-- one, have a valid Flutter installation. So I'll just run Flutter doctor quickly here. Two, have the Firebase CLI installed, and you have authenticated to it. Going to run npm i -g firebase tools to install and then Firebase login to log in. Once that is completed, call this command-- dart pub global activate Flutterfire CLI. This command installs the Flutterfire CLI into our pub cache folder. We need to make sure that this folder exists in our path environment variable before we call it. So I'll add that now to my path and then check that it was added to my user environment. Great. Now that we have the CLI installed, let's initialize a new project. I'm creating a new Flutter project and then opening that project in our editor. We are in the project directory. I'm opening a terminal and first adding the Firebase core plugin. This plugin is required for communicating with your Firebase services. Then we call Flutterfire configure. This runs through the configuration wizard for setting up Firebase with Flutter. It starts by asking you to choose an existing Firebase project or creating a new one. Since I already have one created, I will select it here. It then asks you to select the platforms that you want to target. The current supported platforms are iOS, Android, macOS, and web. The Flutterfire CLI creates app descriptors in your selected Firebase project. Or, if there are pre-existing app descriptors in the project, it links them to your Flutter project only if they share a package name. The CLI then creates a configuration file called Firebase options.dart. That associates your Flutter app with a corresponding app descriptor for each platform in the Firebase project. Let's take a look at that file now. Here we can see some of my app descriptors. Once that is completed, in our main app code, we can just call Firebase initialize app to connect to our Firebase services, passing in the default Firebase options, which the Flutterfire CLI created for us. Great. We are all connected. If you want to add an additional plugin, like Cloud Firestore, you can use the Flutter pub Git command to add them now. There you go. With just a couple of minutes used, we have installed, set up the CLI, and linked our Flutter project to an existing Firebase project. You are now ready to start using Firebase in your Flutter project. For the latest information, please, check out the documentation linked in the description below. If you found this video helpful, leave a like and subscribe for more Flutter and Firebase content. I'm Alexander Nohe, and I am so excited to see what you build next. [MUSIC PLAYING]
Info
Channel: Firebase
Views: 79,856
Rating: undefined out of 5
Keywords: Add firebase to your flutter app, how to add firebase to your flutter app, getting started with firebase, how to get started with firebase, getting started with Firebase fundamentals, intro to firebase fundamentals, what are firebase fundamentals, firebase fundamentals tutorial, firebase developer, firebase developers, google developer, google developers, firebase, google, android, flutter, flutter developers
Id: FkFvQ0SaT1I
Channel Id: undefined
Length: 3min 20sec (200 seconds)
Published: Thu Mar 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.