flutter_launcher_icons icon indicating copy to clipboard operation
flutter_launcher_icons copied to clipboard

Svg

Open ghost opened this issue 6 years ago • 18 comments

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.

ghost avatar Apr 30 '18 11:04 ghost

hi @gedw99 , Yes it is possible we will look into this and get back to you.

franzsilva avatar May 02 '18 21:05 franzsilva

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

ghost avatar May 03 '18 07:05 ghost

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 :)

NatoBoram avatar Feb 04 '19 19:02 NatoBoram

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

connectety avatar Mar 25 '19 15:03 connectety

I somewhat implemented SVG support using inkscape. (meaning you have to install inkscape to use it)

Before merging the changes I want to: - add SVG support for adaptive icons - support custom Inkscape install paths - look into android vector image support for android - test MacOS support (I do not have a Mac for that :( and would require the help of someone who does) - get feedback on what to improve

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 avatar Apr 12 '19 18:04 connectety

@connectety it's work in progress right now, wouldn't recommend anyone to use it until it's merged into master branch

MarkOSullivan94 avatar Nov 17 '19 22:11 MarkOSullivan94

I also would really like this feature. Is there any progress? Is there anything we can do to help?

mqus avatar Feb 24 '20 20:02 mqus

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 ?

Nioux avatar Mar 11 '20 10:03 Nioux

I would really like this feature merged

PolymathWhiz avatar Aug 24 '20 03:08 PolymathWhiz

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.

masseelch avatar Nov 19 '20 18:11 masseelch

I would really like this feature merged, too

Qubitza avatar Mar 16 '22 20:03 Qubitza

same here, all my artwork for my projects is done in svg....

nohkumado avatar Jun 14 '22 13:06 nohkumado

Dart's svg support is not great. Are you able to load them ok?

bradintheusa avatar Jun 14 '22 14:06 bradintheusa

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

HannesGitH avatar Sep 21 '22 09:09 HannesGitH

Any updates on support svg?

Thanks

Sun3 avatar Mar 27 '24 17:03 Sun3