flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.48k stars 27.32k forks source link

We'd need a way to import our custom designed animated icons into flutter #79450

Closed MasiaVittorio closed 3 years ago

MasiaVittorio commented 3 years ago

Use case

The only way to use AnimatedIcons on flutter is to use the pre-compiled ones provided with the framework.

https://shapeshifter.design is a tool made for animating icons and create beautiful results as shown in the material guidelines: https://material.io/design/iconography/animated-icons.html#transitions

Ironically enough, most of the transitions shown in the guidelines are not even provided among the AnimatedIcons presets.

The AnimatedIcon widget can only use AnimatedIconData objects as provided by the few constants inside the AnimatedIcons class.

If we design some animated icons ourselves, there's no way of using them within the flutter framework through the AnimatedIcon widget.

Proposal

As I understand it, the original animated icons provided by the flutter team are converted as pure dart files through this "vitool" tool: https://github.com/flutter/flutter/tree/master/dev/tools/vitool

But it seems to be intended for private use and don't support all SVG commands, so it was used for the few constants provided by Flutter's material library but it doesn't aim to let any developer bring their custom animated icons to their flutter apps.

I think we would greatly benefit from a way to import our own custom designs into flutter, just like the FlutterIcon website (https://www.fluttericon.com) can grab our static SVG files, and compile them into a font file and a dart file file we can use to import our custom icons as a flutter IconData object.

A tool that is able of grabbing animated vector drawables (or an equivalent kind of file format) and convert them to dart files we can import in our flutter projects and use through the AnimatedIcon widget, would make for way nicer applications.

EDIT: I understand that there might be performance implications in using any svg as source, and I think I understand that the vitool tool I was talking about earlier offers limited support because of that?
Anyway, an user friendly implementation that could import even just a subset of svg animations (like in its current state) and convert them into usable dart files for any dev to import and use in their flutter apps, would be more than enough.

MrBirb commented 3 years ago

@pedromassangocode duplicate #19404 ?

pedromassangocode commented 3 years ago

I think this is a duplicate of https://github.com/flutter/flutter/issues/19404.

@MasiaVittorio (and anyone interested in this) please follow up on that issue, I'm closing the current one as a duplicate. If you disagree, please write in the comments and I will reopen it. Thank you

Thanks @MrBirb

MasiaVittorio commented 3 years ago

You're right, @pedromassangocode sorry about that. I will elaborate on the topic on the original issue.

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.