Open Tejas-MD opened 4 years ago
I am using Provider
and Notifier Object
for the purpose, I felt it more convenient to handle than using streams...
In the StreamBuilder
are you getting any values....
In the
StreamBuilder
are you getting any values....
Hi, Thanks for the reply!
To check the same, I checked hasData
for snapshot and it resulted in false as expected in the beginning, during the initial build.
But, the widget didn't seem to rebuild upon successful subscription. The problem is, I'm unsure of which of the two might be the problem:
The Stream is not transmitting any data due to improper application of the same.
The widget inside hasData==true
is not rebuilding because there is no setState
. (I couldn't add a setState anywhere nearby despite efforts.)
Please help diagnose and find solutions. I'm stuck.
Hi, I'm working on a similar MQTT based flutter project and I had to use streams for rebuilding my widgets upon message arrival. Why is it not essential here?
My Stream is not working tho, I'm using a stream controller to sink payload right after the the variable 'pt' is created and assigned a value. I'm listening to it with StreamBuilder Widget on main.dart and rebuilding a card based on it.
The issue is: the card does not rebuild upon message arrival. I can see the message print on the console(using Print) but the listener/subsriber doesn't seem to be working well.
Code:
Listener:
Please help