I have both Flutter and Dart installed independently, because I need a specific version of Dart for some tasks.
This causes Flutter to complain about Dart path (on MacOS, but probably same on Linux):
Warning:
darton your path resolves to /opt/homebrew/Cellar/dart/3.2.4/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/francesco/flutter. Consider adding /Users/francesco/flutter/bin to the front of your path.
Is there a way for Flutter to configure path for Dart (and .pub-cache presumably) overriding the global variables?
My .zshrc below:
### DART
export PATH="$HOME/.pub-cache/bin:$PATH"
export PATH="$HOME/flutter/bin:$PATH"
export PATH="/opt/homebrew/opt/dart/bin:$PATH"
See a use case for this question. See also this discussion with Flutter team members.
If you want to run different versions of Flutter on your system. You need to use FVM. And you can't override the global path. However you can downgrade or upgrade your SDK by the command
and