I have a map in which i store key and value pair. I have put this map in a stream, which we will call dataStream for ease.
now i have a stream builder, this stream-builder uses dataStream. I want this stream builder to build only if a specific key's value is altered.
Currently my stream builder responds to any change in the map. I want to instruct it to change only when a certain key's value in the map changes. Is this possible in stream builder and how?
return StreamBuilder(
stream: dataBloc.dataStream,
builder: (context, snapshot) {
if(snapshot.hasData){
Map<String, String> dataMap = snapshot.data;
// some logic
}
return widget;
}
I want to see if a specific key's value in this map changes, only then rebuild my existing widget else, leave it as it is. Do not build it again