flutter_launcher_icons
flutter_launcher_icons copied to clipboard
Svg
I have used this before and it's such a Time saver.
Do you think svg support it possible ?
There is a dart package that converts svg to a bitmap on pub. So you could use that.
I have been using the svg approach for all images in my apps because it ensures it looks good on a tablet or a little mobile. Once a bit at has been generated at runtime I save it and use that from then on. This allows the image to be cached.
Just thought this was worth mentioning.
hi @gedw99 , Yes it is possible we will look into this and get back to you.
Here it is:
https://github.com/flutter/engine/pull/5060
example
[if(feature='Flutter.Image.encodeImage')]
enum EncodedImageFormat {
[if(feature='Flutter.Image.encodeImage.jpeg')]
JPEG,
[if(feature='Flutter.Image.encodeImage.png')]
PNG,
[if(feature='Flutter.Image.encodeImage.webp')]
WEBP,
}
class Image ... {
[if(feature='Flutter.Image.toByteData')]
Future<ByteData> toByteData({EncodingFormat format: const EncodingFormat.jpeg()}) { ... }
[if(feature='Flutter.Image.encodeImage')]
void encodeImage(EncodedImageFormat format, int quality, ImageEncoderCallback callback) { ... }
}
also checkout https://github.com/dnfield/flutter_path_drawing
I tried to use this package, but turns out it doesn't support SVG.
Android minSdkVersion = 16
Creating default icons Android
Overwriting the default Android launcher icon with a new icon
NoSuchMethodError: The getter 'width' was called on null.
Receiver: null
Tried calling: width
pub finished with exit code 2
Ping me when SVG is supported :)
I took a sharp look at implmenting SVGs. The problem is rendering/converting the SVG to PNG. I was not able to find a library with working SVG which does not depend on flutter.
I believe that, if it depends on flutter it must be run with the flutter command like an Flutter-app. I would be pleased if someone tells me I am incorrect and what library to use / how to run a CLI-app which depends on dart:ui (flutter exclusive I think).
Probably correct ways to do this:
- a fork of flutter_svg, which does not have any dependencies on flutter.
- a standalone library just for this
Workarounds:
- using flutter_svg and running the converting stuff via
flutter test
, which again gets called via console - running some non dart code via console, which can convert to PNG
I somewhat implemented SVG support using inkscape. (meaning you have to install inkscape to use it)
If you want to help / take a look at it check out my branch: https://github.com/connectety/flutter_launcher_icons/tree/svg
I have deleted the branch in favor of the official SVG branch (WIP use on your own risk!) https://github.com/fluttercommunity/flutter_launcher_icons/tree/svg
dev_dependencies:
flutter_launcher_icons:
git:
url: git://github.com/fluttercommunity/flutter_launcher_icons.git
ref: svg
@connectety it's work in progress right now, wouldn't recommend anyone to use it until it's merged into master branch
I also would really like this feature. Is there any progress? Is there anything we can do to help?
We are interrested to use it in our project too, but svg support is a requirement right now. Is there a planned date for this feature ?
I would really like this feature merged
If you are on unix simply use convert logo.svg logo.png
and you have a valid png to use for this package. I make a bash script which just converts svg to png, then calls this package.
I would really like this feature merged, too
same here, all my artwork for my projects is done in svg....
Dart's svg support is not great. Are you able to load them ok?
If you are on unix simply use
convert logo.svg logo.png
and you have a valid png to use for this package. I make a bash script which just converts svg to png, then calls this package.
problem is that then the icons would still be png in the final package which is not desirable, the android_vector xml assets would be much better
Any updates on support svg?
Thanks