Skip to content

[BUG]: Latest flutter_svg requires parameter theme on SvgPicture.asset to be non-nullable #372

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

Closed
2 tasks done
mrkahfi opened this issue Mar 23, 2023 · 2 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@mrkahfi
Copy link

mrkahfi commented Mar 23, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Version

5.2.0

Command type

Dart command

What happened?

Hi, for some reason I am using the latest version of flutter_gen_runner and flutter_svg.

However when I ran command:

fluttergen -c pubspec.yaml

It succcessfully generated the assets.gen.dart file containing 1 error, which is:

The argument type 'SvgTheme?' can't be assigned to the parameter type 'SvgTheme'

Seems like the latest flutter_svg requires the parameter theme to be non-nullable.

Of course this can be easily fixed by hand by making the parameter theme required and non-nullable. But we're looking forward to get flutter_gen compatible with the latest version of flutter_svg.

Relevant a pubspec.yaml.

dependencies:
  flutter_svg: ^2.0.4 # Latest version as of now

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_gen_runner: ^5.2.0  # Latest version as of now

flutter_gen:
  output: lib/gen/ # Optional (default: lib/gen/)
  line_length: 80 # Optional (default: 80)

  integrations:
    flutter_svg: true

flutter:
  assets:
    - assets/images/

Relevant log output

The argument type 'SvgTheme?' can't be assigned to the parameter type 'SvgTheme'

Code of Conduct

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

subzero911 commented Jul 4, 2023

Same here
image

actual in flutter_gen_runner: ^5.3.1

@bramp
Copy link
Contributor

bramp commented Oct 14, 2023

This was fixed in #350

@AlexV525 AlexV525 closed this as completed Mar 7, 2024
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

No branches or pull requests

4 participants