Stream<T> log({String? tag}) => map((e) { // ignore: avoid_print print('[${tag ?? 'Stream'}] $e'); return e; });