Sometimes, when I´m watching some projects that work with streams, I see something like:
final controller = StreamController<Null>();
and then:
controller.sink.add(null);
So, is allowed to pass null in streams? Why?
Sometimes, when I´m watching some projects that work with streams, I see something like:
final controller = StreamController<Null>();
and then:
controller.sink.add(null);
So, is allowed to pass null in streams? Why?
Nullas generic type argument was used beforevoidwas supported and means in this case that only the occurence of the even is meaningful, but the event value is not.With
Nullthe valuenullis the only valid event value. Withvoida callback function can be passed that does not take any parameter.