I am trying to fetch only a Map field stored in a document of Firestore collection instead of fetching the whole document which is obviously more time taking and bandwidth consuming.
This is the way I am getting my data from a Map Field which is defined inside a Document named by UserID of a particular user -
DocumentSnapshot snap = await driversRef.doc(user!.uid).get();
email = ((snap.data() as Map)['profile'] as Map)['email'];
name = ((snap.data() as Map)['profile'] as Map)['name'];
mobile = ((snap.data() as Map)['profile'] as Map)['mobile'];
age = ((snap.data() as Map)['profile'] as Map)['age'];
address = ((snap.data() as Map)['profile'] as Map)['address'];
But as said above, it is getting the entire document in the first line of the code.
Is there any way i can get just a particular field of any data type from a Firestore document?