I'm setting up a category selector where pressing a certain image changes the category the user is supposed to see. however if the user doesn't pick a category he should see all items.
FutureBuilder(
future: _authService.getUserId(),
builder: (context, snapshot) {
if (snapshot.hasData)
return StreamBuilder(
stream: _firestore
.collection('Item')
.where(_category != null ? ('category', isEqualTo: _category) : true)
.snapshots(),
I was trying to do something like this but it just gives me an error saying it was expecting a bracket somewhere..
Another question I have about this setup is, even if the _categoy changes, would that update the list? or since the stream is already built it won't? and in the latter, how would I come about updating the list with the actual values?