flush method

List<SseEvent> flush()

Flushes any buffered partial frame (call once at stream end).

Implementation

List<SseEvent> flush() {
  final text = _buffer.toString();
  _buffer.clear();
  if (text.trim().isEmpty) return const [];
  final event = _parseFrame(text);
  return event == null ? const [] : [event];
}