add method

List<Json> add(
  1. String chunk
)

Implementation

List<Json> add(String chunk) {
  _buffer.write(chunk);
  final text = _buffer.toString();
  final end = text.lastIndexOf('\n');
  if (end < 0) return const [];
  _buffer
    ..clear()
    ..write(text.substring(end + 1));
  text.substring(0, end).split('\n').forEach(_parser.line);
  return _take();
}