FlutterFire Tutorial [2024]🔥
For those who don't know FlutterFire is a Firebase plugins for Flutter.
🤓 Firebase provides a set of backend computing services for app development.
Firebase CLI setup
First if you already haven't , set up Firebase CLI on your device:
If you have npm run the following command :
npm install -g firebase-tools
After installation of Firebase CLI run the following command to login:
firebase login
If don't have npm follow the following documentation:
Creating a new Firebase Project
Go to your firebase console on your browser
Add a new project with <Project-Name>
For android app :
A) Click on the android icon that you will be asked to register your app
B) fill the name same as that given in the namespace option in your \>Project>android>app>build.gradle file
C) For the Next Step you have to download the google-service.json file and paste in \>Project>android>app Folder
D) After this add all the necessary dependencies as directed.
Now in your flutter project add this add firebase core package :
flutter pub add firebase_core
Add the following code in main function :
Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp() runApp(const Home()); }
Also import the flutter_core package
Now try to run the app if it runs successfully than than your are ready to move to use all the firebase services.
Now lets see how to add authentication using firebase in the next tutorial : Link
Connect with me on socials and lets learn together:
LinkedIn : https://www.linkedin.com/in/priyanshu-sidar-639914144/
Twitter : https://x.com/Sidar3Sidar?s=09
Instagram : https://www.instagram.com/cyrax_i_king/
Subscribe to my newsletter
Read articles from Priyanshu Sidar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by