FirebaseFirestore.instance
.collection('users')
.doc(userId)
.get()
.then((DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists) {
print('Document exists on the database');
Map<String, dynamic> data =
documentSnapshot.data() as Map<String, dynamic>;
}
});
static Future<List<AustinFeedsMeEvent>> _getEventsFromFirestore() async {
CollectionReference ref = Firestore.instance.collection('events');
QuerySnapshot eventsQuery = await ref
.where("time", isGreaterThan: new DateTime.now().millisecondsSinceEpoch)
.where("food", isEqualTo: true)
.getDocuments();
HashMap<String, AustinFeedsMeEvent> eventsHashMap = new HashMap<String, AustinFeedsMeEvent>();
eventsQuery.documents.forEach((document) {
eventsHashMap.putIfAbsent(document['id'], () => new AustinFeedsMeEvent(
name: document['name'],
time: document['time'],
description: document['description'],
url: document['event_url'],
photoUrl: _getEventPhotoUrl(document['group']),
latLng: _getLatLng(document)));
});
return eventsHashMap.values.toList();
}
Open the pubspec. ...
Add your Flutter application to Firebase by clicking on the Android icon.
Add your application's package name as shown in the image below.
You can find your package name in the app-level – build. ...
Download the google-services. ...
Paste classpath 'com.
Open the pubspec. ...
Add your Flutter application to Firebase by clicking on the Android icon.
Add your application's package name as shown in the image below.
You can find your package name in the app-level – build. ...
Download the google-services. ...
Paste classpath 'com.