Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

dart async stream

Future<int> sumStream(Stream<int> stream) async {
  var sum = 0;
  await for (var value in stream) {
    sum += value;
  }
  return sum;
}
Source by dart.dev #
 
PREVIOUS NEXT
Tagged: #dart #async #stream
ADD COMMENT
Topic
Name
1+2 =