GeneratorApp.stdio constructor

GeneratorApp.stdio({
  1. required Stdin stdin,
  2. required Stdout stdout,
})

Implementation

factory GeneratorApp.stdio({
  required Stdin stdin,
  required Stdout stdout,
}) {
  final input = stdin.transform(utf8.decoder).transform(const LineSplitter());

  final controller = StreamController<String>();
  controller.stream.listen(stdout.writeln);

  return GeneratorApp.channel(input: input, output: controller.sink);
}