presentStreamTransform method

void presentStreamTransform()

howTo:Stream Note: how to add to stream.. with streamController !!

Implementation

void presentStreamTransform() {
  //  TODO  teamHowTo    make roundWay
  //  TODO  goals  error;  make list here
  Stream thisEveningStream =
      Stream.fromIterable(letterList); // create the stream
//  var thisEveningStream = new Stream.fromIterable(eveningStream);  // create the stream

  //  check properties: Just nime one, and play.
  thisEveningStream.toString();

  /// define a stream transformer
  var transformer = StreamTransformer.fromHandlers(handleData: (value, sink) {
    // create two new values from the original value
    //  The method "add" is not defined for method void.
    //  sink.add("Message: $value").add("Body: $value");
    //  sink asks (dynamic event)
    //  hklTry: ("Body: $value"  ok. error away.
    sink.add("Body: $value"); // add("Message: $value").add("Body: $value");
  });

  //  Just use it: watch properties.
  transformer.runtimeType;

  /// transform the stream and listen to its output
  ///  TODO  check Null update NNBD for new functioning code year 2022
  ///  TODO  Temporarily away
  //** AWAY   thisEveningStream
  //** AWAY       //  howTo Stream transformer
  //** AWAY       .transform(transformer)
  //** AWAY       .listen((value) => print("listen: $value"));
}