destream static method

Future<StreamedResults> destream(
  1. StreamedResults results
)

Takes a _ResultsImpl and destreams it. That is, it listens to the stream, collecting all the rows into a list until the stream has finished. It then returns a new _ResultsImpl which wraps that list of rows.

Implementation

static Future<StreamedResults> destream(StreamedResults results) async {
  List<Row> rows = await results.toList();
  var newStream = Stream<Row>.fromIterable(rows);
  List<Field> f = results.fields != null ? results.fields as List<Field> : <Field>[];
  return StreamedResults._fromStream(results.insertId, results.affectedRows, f, newStream);
}