Closed cntoss closed 6 months ago
Use Stream.first instead single
I did not get it. if I do stream.first and then on streambuilder I did not get updated response on stream that means if I do _order.sink.add('hello'); I only get 'xyz' which is first value of stream.
@cntoss please add some codes to reproduce this issue
Have you resolved this? I get the same exception.
Have you resolved this? I get the same exception.
Did you use behaviorSubject.single
?
Below is an error on behaviorsubject when .sink.add called more than once this error is not always happen
sample code:
if I called update() method several times then I got exception
Unhandled Exception: Bad state: Too many elements
0 Stream.single. (dart:async[/stream.dart:1354:11]())
1 _rootRunUnary (dart:async[/zone.dart:1434:47]())
2 _CustomZone.runUnary (dart:async[/zone.dart:1335:19]())
3 _CustomZone.runUnaryGuarded (dart:async[/zone.dart:1244:7]())
4 _BufferingStreamSubscription._sendData (dart:async[/stream_impl.dart:341:11]())
5 _BufferingStreamSubscription._add (dart:async[/stream_impl.dart:271:7]())
6 _MultiStreamController.addSync (dart:async[/stream_impl.dart:1129:36]())
7 _MultiControllerSink.add
package:rxdart/…/utils/forwarding_stream.dart:135
8 _StartWithStreamSink.onData
package:rxdart/…/transformers/start_with.dart:12
9 _rootRunUnary (dart:async[/zone.dart:1434:47]())
10 _CustomZone.runUnary (dart:async[/zone.dart:1335:19]())
11 _CustomZone.runUnaryGuarded (dart:async[/zone.dart:1244:7]())
12 _BufferingStreamSubscription._sendData (dart:async[/stream_impl.dart:3]()<…>