Skip to content

Create doc page that describes all possible ways to set path to flutter. #4665

Closed

Description

@polina-c

Now, when there are so many ways to set SDK in VSCode, including hidden way to build project and thus set flutter path to what was used for the build, a page that describes all of them and their priorities for VSCode, would really help.

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Jul 27, 2023
  2. DanTup commented on Jul 27, 2023

    @DanTup
    Member

    There are a lot of places that we look for SDKs, but this is mostly because we want to do our best to find the SDK. I'm not sure we should document them all as ways you can set the SDK, because really users should only ever directly a) add an SDK to PATH or b) use the dart.sdkPath/dart.flutterSdkPath settings. I don't think we should guide them towards anything else, however I do think we should make it easier to understand how we found the SDK we're using.

    Perhaps we should add a command that can provide information about how the current SDK was located, such as a "Doctor" command. It could detail the SDK search including where it looked, and which paths were discounted because they were not valid.

    For example:

    Workspace contains Flutter project, searching for a Flutter SDK:
    
    - Workspace settings                       Not Found
    - User settings                            Invalid C:\Deleted-Flutter-SDK\ (folder does not exist)
    - Project package_config.json              Found C:\Flutter\SDK used by C:\MyProject\.dart_tool\package_config.json
    - Project ./.flutter                       Not Found
    - Project ./vendor/flutter                 Found C:\MyProject\vendor\flutter
    - FLUTTER_ROOT environment variable        Invalid C:\Broken-Flutter-SDK\ (does not contain a bin\flutter file)
    - Snap (~/snap/flutter/common/flutter)     Not Found
    - ~/flutter-sdk                            Not Found
    - /google/flutter                          Not Found
    - PATH environment variable                Found C:\Flutter\SDK
    
    Using first valid SDK C:\Flutter\SDK found via Project package_config.json.
    
  3. added this to the v3.72.0 milestone on Jul 27, 2023
  4. added
    in docs / websiteRelates to documentation, including the Dart Code website
    on Jul 27, 2023
  5. incendial commented on Jul 27, 2023

    @incendial

    @DanTup you don't have first-class support for fvm, why?

  6. DanTup commented on Jul 27, 2023

    @DanTup
    Member

    There's already support for switching of SDKs here and it works with both Dart and Flutter (and doesn't require installing additional tools). It's been a while since I looked at it, but I believe fvm requires (or required) running everything through it (fvm flutter run) and since we spawn lots of the SDK tools for different purposes, having to plumb all that through didn't seem worth it (I'm not really sure what benefit there would be over what we already have).

    (We also need to locate files inside the SDK, so we need to know the path, not just that we can run fvm to get the right version)

  7. incendial commented on Jul 28, 2023

    @incendial

    It's been a while since I looked at it, but I believe fvm requires (or required) running everything through it (fvm flutter run)

    Interesting, was not aware of that.

    (We also need to locate files inside the SDK, so we need to know the path, not just that we can run fvm to get the right version)

    This one is doable, I supported both fvm and fvm default in DCM.

  8. DanTup commented on Jul 31, 2023

    @DanTup
    Member

    Looks like FVM already has docs for working with VS Code's built-in switcher at https://fvm.app/docs/getting_started/configuration/#vs-code (for both detecting the current SDK, and using the switcher to switch between FVM versions). I don't use it so I don't know if there are things that don't work this way though.

    I'm open to improving support for other version managers if there's demand, but I'd rather do that in ways that are open to all version managers and don't require specific coding for individual apps because it's not very scalable to build them all in (for ex. https://puro.dev/ is another popular one).

  9. modified the milestones: v3.72.0, v3.74.0 on Aug 31, 2023
  10. modified the milestones: v3.74.0, v3.76.0 on Sep 26, 2023
  11. modified the milestones: v3.76.0, v3.78.0 on Oct 31, 2023
  12. modified the milestones: v3.78.0, v3.80.0 on Nov 29, 2023
  13. modified the milestones: v3.80.0, v3.82.0 on Dec 21, 2023
  14. modified the milestones: v3.82.0, On Deck on Jan 25, 2024
  15. modified the milestones: On Deck, v3.100.0 on Oct 21, 2024
  16. DanTup commented on Oct 21, 2024

    @DanTup
    Member
  17. added a commit that references this issue on Mar 24, 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

    in docs / websiteRelates to documentation, including the Dart Code websiteis 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