📜  飞镖异步流 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:45.387000             🧑  作者: Mango

代码示例1
Future sumStream(Stream stream) async {
  var sum = 0;
  await for (var value in stream) {
    sum += value;
  }
  return sum;
}