Skip to content

Custom commands to obtain the Dart and Flutter SDK roots dynamically  #5334

Closed

Description

@davidmartos96

Is your feature request related to a problem? Please describe.

This is a proposal to fix issues such as #5117 , where the path to the SDK is not statically known when using tools such as ASDF, mise or direnv.
It would be great if there was a setting which lets the user provide a command to run that should print to stdout the SDK path. This would allow a project to provide a command such as asdf where flutter with the working directory being the firstFlutterProject variable in the extension source code or the workspaceFile directory in case there is one.
This would let these kind of tools automatically switch vesions according to each project requirements or even let the user define a custom shell/python script based on their own rules.

Describe alternatives you've considered
I've tried using the FLUTTER_ROOT variable in the shell configuration as "$(asdf where flutter)", but that will not be dynamic, which defeats the whole purpose of these versioning tools.

The following simple proof of concept works as expected.

image

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Nov 11, 2024
  2. added this to the On Deck milestone on Nov 14, 2024
  3. modified the milestones: On Deck, v3.104.0 on Jan 21, 2025
  4. added a commit that references this issue on Jan 21, 2025
    b1f79db
  5. changed the title [-]Custom command to obtain the Flutter SDK root dynamically [/-] [+]Custom commands to obtain the Flutter and Flutter SDK root dynamically [/+] on Jan 21, 2025
  6. changed the title [-]Custom commands to obtain the Flutter and Flutter SDK root dynamically [/-] [+]Custom commands to obtain the Dart and Flutter SDK roots dynamically [/+] on Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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