>>> void main() { var controller = new StreamController(sync: true, onCancel: () { return Future.wait(operationSet.map((operation) => operation.cancel())); }); } <<< void main() { var controller = new StreamController( sync: true, onCancel: () { return Future.wait(operationSet.map((operation) => operation.cancel())); }, ); }