assets/images/Defect/icon-5.svg
I need to get svg on above String
example:
print(path);
output only svg
There is a function called extension in package:path/path.dart that will give you the extension of a file. If you want to remove the . from that extension you just need to replace it with an empty space, something like:
import 'package:path/path.dart';
String svg = extension("assets/images/Defect/icon-5.svg");
svg = svg.replaceAll(".", "");
print(svg);
Reference here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With