I have been stuck with this for days now, I have difficulty accessing my firebase database from my flutter project. I have followed all the instructions to adding firebase to an android app on flutter and tried many suggested solutions on the web but I'm still stuck. I hope someone will be patient or kind enough to help me out. I have put all the necessary snippets below.
My dependencies
dependencies:
flutter:
sdk: flutter
google_maps_flutter: ^2.0.6
proj4dart: ^2.0.0
location: ^4.2.0
cloud_firestore: ^2.5.1
firebase_core: ^1.6.0
my imports
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
my function to retrieve the data from firestore
Future getControls() async{
await Firebase.initializeApp();
FirebaseFirestore firestoreInstance = FirebaseFirestore.instance;
QuerySnapshot data = await firestoreInstance.collection('Controls').get();
}
My google service JSON file
**
I may not be doing it right, or there is something I'm missing. Can someone please help me out .... mmmhh. Thanks in Advance
**



