I was trying to change the below flutter firebase realtime database code to cloud firestore, but I am getting this errors...
- error: The method 'child' isn't defined for the type 'Query'.
- error: The method 'push' isn't defined for the type 'Query'.
DatabaseReference databaseReference = FirebaseDatabase.instance.reference().child('Products');
String uploadId = databaseReference.push().key;
HashMap map = new HashMap();
map['productName'] = productName;
map['productCat'] = selectedCat;
map['startingPrice'] = int.parse(startingPrice);
map['gapPrice'] = int.parse(gapPrice);
map['imageSrc'] = url;
map['timeStamp'] = DateTime.now().toString();
databaseReference.child(uploadId).set(map);