Adding svg images in Flutter app
In this article we will discuss about how to add svg images in our flutter app.
Whenever it comes to adding images in our flutter app we usually go for .png, .jpeg, jpg, or .svg images. Each format is unique with their styles.
But most of the developers and designers usually prefer .png or .svg images. The primary reason would be because of their transparent background, but there are many other differences between these two image formats which are listed below as follows., 👇
- PNG (Portable Network Graphics)
Png images offers high-resolution, lossless compression and transparency.
These are raster-based files which usually make them the best choice for adopting in most places.
2. SVG (Scalable Vector Graphics)
These are vector based files, which means that the image is rendered based on mathematical algorithms. This provides with the additional advantage of scaling up or down without negatively impacting their quality. Along with that they too help with SEO(Search Engine Optimization).
Each format comes with their own advantages, If we need high resolution image that can handle multiple colors then .png would be the best choice, where as if we are dealing with logo design, or want to play around with the same image of different sizes without being pixelated then .svg would be the format to consider.
flutter_svg | Flutter Package
Draw SVG (and some Android VectorDrawable (XML)) files on a Flutter Widget. This is a Dart-native rendering library…
- Add the svg image inside the project by creating new folder (assets/Images)
2. Update the
pubspec.yaml file by providing the image file path as follows.
3. Finally render the image in UI using
Well that’s it. 🎉 Run the app to see it in action.🥳
Check out all my Flutter related blogs here.,👇
Other articles you may like.,
Shared Preferences in Flutter
Store the data locally in Flutter app using Shared Preferences.
Setting up your Flutter app for publishing in Play Store.
Before publishing our Flutter app in Google Play Store we need to brush up few feature to make sure that the app is…
Creating Desktop Apps using Flutter
In this article we will discuss about how to create and run a desktop app using Flutter.
If you found this article useful and wish to support my work, you can consider buying me a ☕️ coffee.👇
VIJAY R is Content Creator
Hey 👋., I just started the page. Support by buying me a coffee.
If you want to know more about Flutter and various Widgets in Flutter…?🤓 Then visit my channel 👉🏻 vijaycreations🚩