Say my document like this: -user_id: -name -address -A lot of heavy data.
I know I could get the entire document and just display the fields that I want, but I nedd to retrieve only name and address from my document, so that my users can save bandwidth.
How can I do this?
PD: this is how I would retrieve the whole document.
return StreamBuilder(
stream: Firestore.instance
.collection('users')
.document(widget.userId.toString())
.snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.deepOrange),
),
);
} else {
return _buildUserTile(context, snapshot.data);
}
},
);