Skip to content

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

Closed
@mrkahfi

Description

@mrkahfi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions