useStreamController<T> function

StreamController<T> useStreamController<T>({
  1. bool sync = false,
  2. VoidCallback? onListen,
  3. VoidCallback? onCancel,
  4. List<Object?>? keys,
})

Creates a StreamController which is automatically disposed when necessary.

See also:

Implementation

StreamController<T> useStreamController<T>({
  bool sync = false,
  VoidCallback? onListen,
  VoidCallback? onCancel,
  List<Object?>? keys,
}) {
  return use(
    _StreamControllerHook(
      onCancel: onCancel,
      onListen: onListen,
      sync: sync,
      keys: keys,
    ),
  );
}