Skip to content

[BUG]: DartFormatter.latestLanguageVersion is supported by dart_style v2.3.7 and above #651

@koji-1009

Description

@koji-1009

Is there an existing issue for this?

  • I have searched the existing issues

Version

5.9.0

Command type

build_runner (Default)

What happened?

DartFormatter.latestLanguageVersion is used in v5.9.0, but there is a problem with the version of dart_style required by flutter_gen_runner.

https://github.com/FlutterGen/flutter_gen/blob/v5.9.0/packages/core/lib/flutter_generator.dart#L37

DartFormatter.latestLanguageVersion is a property added in dart_style v2.3.7.

https://github.com/dart-lang/dart_style/blob/v2.3.7/lib/src/dart_formatter.dart#L30

https://github.com/dart-lang/dart_style/blob/v2.3.6/lib/src/dart_formatter.dart#L27

However, in pubspec.yaml dart_style: ‘>=2.2.4 <4.0.0’ is specified.

https://github.com/FlutterGen/flutter_gen/blob/v5.9.0/packages/core/pubspec.yaml#L27

This causes flutter_gen_runner to fail to run in projects that use dart_style 2.3.6 or lower versions due to other packages.

Relevant a pubspec.yaml.

Relevant log output

[WARNING] ../../.pub-cache/hosted/pub.dev/flutter_gen_core-5.9.0/lib/flutter_generator.dart:37:38: Error: Member not found: 'latestLanguageVersion'.
      languageVersion: DartFormatter.latestLanguageVersion,
                                     ^^^^^^^^^^^^^^^^^^^^^

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions