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

[BUG]: SvgPicture.asset generated code not compatible with latest flutter_svg #368

Closed
2 tasks done
jetpeter opened this issue Mar 14, 2023 · 8 comments · Fixed by #369
Closed
2 tasks done

[BUG]: SvgPicture.asset generated code not compatible with latest flutter_svg #368

jetpeter opened this issue Mar 14, 2023 · 8 comments · Fixed by #369
Labels
bug Something isn't working
Milestone

Comments

@jetpeter
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Version

5.2.0

Command type

build_runner (Default)

What happened?

Generated code has:
The argument type 'Clip?' can't be assigned to the parameter type 'Clip'.

This is casued by flutter_svg changing the parameter Clip? to Clip: clipBehavior = Clip.hardEdge and removing the deprecated annotation.

https://github.com/dnfield/flutter_svg/blame/master/lib/svg.dart#L181

See flutter_svg 2.0.4

Relevant a pubspec.yaml.

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@komaxx
Copy link

komaxx commented Mar 15, 2023

Same Issue.
For what it's worth: Releasing an update with a (breaking) method signature change as only a patch update (2.0.3 to 2.0.4) is a mistake.

@cogivn
Copy link

cogivn commented Mar 16, 2023

Hi, may I know when the issue will be resolved?
Thanks,

@jetpeter
Copy link
Contributor Author

It will probably be a few days+. Easy fix is to change your flutter_svg from ^2.0.x to 2.0.3 without the carrot so it uses that exact version. 2.0.3 will work with the current flutter_gen.

@cyrilnoah1
Copy link

@FlutterGen team, when can we expect this to be resolved?

@dev-nicelee
Copy link

dev-nicelee commented Mar 21, 2023

For someone who is still stuck with this bug, there is on review PR which will resolve this issue.

(It's a bit hack though..) You can temporarily change clipBehavior in asset.g.dart file like below.

Clip clipBehavior = Clip.hardEdge,

@yauheniprakapenka
Copy link

I am using code generation. As a temporary solution, these steps are helped me to fix the errors:

Error: The argument type 'Clip?' can't be assigned to the parameter type 'Clip' because 'Clip?', colorFilter
Error: No named parameter with the name 'colorFilter'.

  1. Specify versions of flutter_gen_runner: 5.1.0+1 (without carrot) and flutter_svg: 1.1.4 (without carrot)
  2. Go to local pub cache and remove all flutter_gen and flutter_svg versions (for example, my path is /Users/eprakopenko/.pub-cache/hosted/pub.dev)
  3. flutter clean
  4. flutter pub get
  5. flutter pub run build_runner build --delete-conflicting-outputs

@minhnguyenandpad
Copy link

Any update for this?

1 similar comment
@abdulrojakdev
Copy link

Any update for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants