useStreamController<T> function

StreamController<T> useStreamController <T>({bool sync: false, VoidCallback onListen, VoidCallback onCancel, List<Object> keys })

Creates a StreamController automatically disposed.

See also:

  • StreamController, the created object
  • useStream, to listen to the created StreamController

Implementation

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