fromStream static method

Future<SvgDOMManager> fromStream(
  1. Stream<String> input, {
  2. List<Pattern> exportedIDs = const [],
  3. void warnF(
    1. String
    )?,
})

Create a new manager to manage an SVG DOM created from the XML representation in the stream input.

exportedIDs specifies a list of node IDs that are to be exported. Each time build is called, the set returned from the new instance's ScalableImage.exportedIDs will be different than from previous instances.

If warnF is non-null, it will be called if the SVG asset contains unrecognized tags and/or tag attributes. If it is null, the default behavior is to do nothing.

Implementation

static Future<SvgDOMManager> fromStream(final Stream<String> input,
    {List<Pattern> exportedIDs = const [],
    void Function(String)? warnF}) async {
  final warnArg = warnF ?? nullWarn;
  final p = StreamSvgParser(input, exportedIDs, null, warn: warnArg);
  await p.parse();
  return SvgDOMManager._new(p.svg);
}