Native Shopify Mobile App with 20 new features
Kickstart your hyperlocal marketplace in Corona pandemic with a starter guide
Android App Development
iOS App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 188.8.131.52 release ready!
Owner and Founder. Opencart
In this article, we are going to learn how to use SVG in Flutter. So let’s get started.
You may be heard of something like SVG icons because of their popularity among designers or developers.
SVG stands for Scalable Vector Graphics which is an XML-based markup language for describing 2D-based vector graphics. SVG images can be rendered at any size without losing quality.
If you use SVGs like others i.e. png, jpg into your Image.network or Image.asset, you will get an image codec error.
Because they are not supported yet.
Fortunately, there is a solution from the Flutter community, the flutter_svg package.
We start by adding this package to pubspec.yaml:
After that, import it and use it like any other widget into your Flutter project:
I have used this SVG: https://www.svgrepo.com/show/217740/android.svg
If you use SVG that contains <style> element your SVG will be rendered into the flutter app as there are no <style> elements in your SVG or colorless because this package doesn’t support CSS style in SVG yet. You can use inline styles in your SVG which are supported by this package as detailed here.
Thanks for reading.
Happy Coding 🙂
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.