I have StreamBuilder
Widget build(BuildContext context) {
return StreamBuilder(
initialData: false,
stream: widget.stream, ...
For initializing widget I call:
_EventSpeakerPager(..., streamController.stream.distinct());
And this produce error "Bad state: Stream has already been listened to."
Without distinct()
it works, but it's not suitable for me.
I've tried asBroadcastStream()
and got the same error
Does anybody know, how can I handle this
P.S. I've already looked into these:
topic1, topic2, topic3 - nothing helps
P.P.S.
When I use stream without StreamBuilder
- all works fine
void initState() {
super.initState();
widget.stream.listen((bool data) {
setState(() {
...
});
});
}