useStreamController<T> function

StreamController<T> useStreamController<T>({
  1. bool sync = false,
})

Creates a StreamController.

The controller is automatically closed when the widget is unmounted.

Implementation

StreamController<T> useStreamController<T>({
  bool sync = false,
}) {
  final c = StreamController<T>(sync: sync);
  onBeforeUnmount(c.close);
  return c;
}