biocarl / drawing_animation

A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).
https://pub.dartlang.org/packages/drawing_animation
BSD 2-Clause "Simplified" License
488 stars 123 forks source link

Loading SVG via network not possible #15

Open ravindranathakila opened 3 years ago

ravindranathakila commented 3 years ago

At the moment, the library allows loading assets via assets; We would love to be able to load SVG via web. At the moment; as a workaround we do the following:

Modify drawing_animation.dart: Add the line

export 'src/parser.dart';

Load the file via network, and parse the content as:

  SvgParser example(filePath) {
     SvgParser parser = SvgParser();
     parser.loadFromString(File(filePath).readAsStringSync());
     return parser;
  }

Then use it as:

AnimatedDrawing.paths(svgParser.getPaths())

While loading file via network might not be a priority, we would like parser.dart to be available to use meanwhile.

erik-seifert commented 2 years ago

Would be a great feature.

atn832 commented 1 year ago

Have you considered alternatives like https://pub.dev/packages/svg_drawing_animation? I made svg_drawing_animation because I needed a few extra features, and loading from network was among them.