Skip to content

Use flutterRoot instead of looking for the flutter package when reading the sdk path from .package_config.json #5728

@incendial

Description

@incendial

Is your feature request related to a problem? Please describe.
Right now extractFlutterSdkPathFromPackagesFile tries to read the path to the "flutter" package and this works well for flutter projects, but does not work for pure dart projects.

Describe the solution you'd like
In ".package_config.json" there seem to be a field called "flutterRoot" which points to the sdk and is present regardless of the flutter package (and even created when running "dart pub get", though I have flutter installed on my device).

The URIs differ a bit, though:

  1. "rootUri": "file://.../Desktop/flutter/packages/flutter",
  2. "flutterRoot": "file://.../Desktop/flutter",

Maybe it's worth it to read the "flutterRoot" field instead?

Describe alternatives you've considered
_

Additional context
_

Metadata

Metadata

Assignees

No one assigned

    Labels

    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions