If you get such type of error When you run a Project in Flutter App using Firebase then – open “pubspec.yaml” and paste in “dependencies:” like below:
dependencies: | |
flutter: | |
sdk: flutter | |
# The following adds the Cupertino Icons font to your application. | |
# Use with the CupertinoIcons class for iOS style icons. | |
cupertino_icons: ^0.1.3 | |
firebase_auth: ^0.18.0+1 | |
cloud_firestore: "^0.14.0+2" | |
firebase_core: "0.5.0" |
After that open “main.dart” and paste like below:
import 'package:firebase_core/firebase_core.dart'; | |
import 'package:flutter/material.dart'; | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
await Firebase.initializeApp(); | |
runApp(MyApp()); | |
} |
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND