Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Support Asset Transformation #514

Closed
2 tasks done
josh-burton opened this issue May 15, 2024 · 5 comments
Closed
2 tasks done

[FR]: Support Asset Transformation #514

josh-burton opened this issue May 15, 2024 · 5 comments

Comments

@josh-burton
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the problem

Flutter 3.22.0 now supports asset transformation. This allows, for example a .svg to be transformed into a .vec.

https://docs.flutter.dev/ui/assets/asset-transformation

Describe the solution

Support a way to generate asset classes that point to the transformed asset rather than the raw asset

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@josh-burton josh-burton added the enhancement New feature or request label May 15, 2024
@AlexV525
Copy link
Member

As examples are shown in the doc, resolving how transformers handled assets would be overwhelming. To use the asset in different loaders with flutter_gen, simply use its path should be able to compatible with Asset Transformations. In this case, the package will not add additional support for the feature. Feel free to add inputs to my opinion.

@AlexV525
Copy link
Member

Closing as above suggestion. Feel free to leave any further thoughts in the thread.

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
@AlexV525 AlexV525 removed the enhancement New feature or request label May 30, 2024
@Conrad33
Copy link

I think this should be reopened. The proposed solution:

simply use its path should be able to compatible with Asset Transformations

Isn't possible because flutter_gen can't parse the pubspec.yaml when using asset transformations. It gives an error:
There is a problem with "assets". type 'YamlMap' is not a subtype of type 'String' in type cast

This is similar to #494.

@AlexV525
Copy link
Member

This is similar to #494.

So let's track the on that issue, thanks for the reference.

@myxzlpltk
Copy link

myxzlpltk commented Jun 20, 2024

Yes, that error blocking the code generation. Its okay if fluttergen cannot generate that. The package can skip it and I still can call direct path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants