I am looking to convert SVG from assets to png and write it to File.
I have managed to write SVG to file, but I want to write the image to a file as a PNG
code that writes SVG to file :
final bytes = await rootBundle.load('assets/images/example.svg');
final String tempPath = (await getTemporaryDirectory()).path;
final File file = File('$tempPath/profile.svg');
await file.writeAsBytes(
bytes.buffer.asUint8List(bytes.offsetInBytes, bytes.lengthInBytes));
return file;
}