I'm trying to retrieve data from Firebase collection and I'm able to do it partially. I'm only be able to retrieve the data which I manually inputted in the database. I'm not able to retrieve data which has been entered using the 'set()' method.
I have tried using StreamBuilder as well but the result is the same.
Only these are being printed and have been entered manually by me
These are being omitted and have been added using set()
This is how I'm retrieving from the database
initialize() async {
/* var u = await FirebaseFirestore.instance.collection('users').get();
var v = u.docs.toString();
print(v);
*/
CollectionReference ref = FirebaseFirestore.instance.collection('users');
QuerySnapshot users = await ref.get();
print(users.size);
HashMap<String, Profile> data = new HashMap<String, Profile>();
List <Profile> da = [];
for (DocumentSnapshot document in users.docs) {
print(document.id);
CollectionReference profile = document.reference.collection('profile');
var required = await profile.doc('required').get();
//print(required.get('name'));
}