I'm having a bit of confusion about Dart and Pub installs on my system. I Use Android Studio and Flutter which comes with Dart, and if run Dart --version
command in terminal I get Dart SDK version: 2.10.4 (stable) (Wed Nov 11 13:35:58 2020 +0100) on "macos_x64"
which is the latest Flutter stable channel I installed.
Then to install Aqueduct with pub global activate aqueduct
I was having the error pub command not found so I installed it and I had to also install PostgreSQL and Dart via home-brew .
Now to try and solve a bug that seems to be related to the latest version of dart Aqueduct db generate error: Bad state: NoSuchMethodError: The getter 'length' was called on null
I run brew install dart@2.8
but then if I run Dart --version
again I still get Dart SDK version: 2.10.4 (stable) (Wed Nov 11 13:35:58 2020 +0100) on "macos_x64"
Here is the print from console:
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
Updated 7 formulae.
==> Installing dart@2.8 from dart-lang/dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/rele
Already downloaded: /Users/vinnytwice/Library/Caches/Homebrew/downloads/f3ce4b575125184d766bb56931b479589b16972fb0bcfd1e00c841a316c85e25--dartsdk-macos-x64-release.zip
Warning: Your Xcode (11.5) is outdated.
Please update to Xcode 12.3 (or delete it).
Xcode can be updated from the App Store.
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you an update run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/more/.
==> Caveats
Please note the path to the Dart SDK:
/usr/local/opt/dart@2.8/libexec
dart@2.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have dart@2.8 first in your PATH run:
echo 'export PATH="/usr/local/opt/dart@2.8/bin:$PATH"' >> ~/.zshrc
==> Summary
/usr/local/Cellar/dart@2.8/2.8.1: 502 files, 486MB, built in 34 seconds
How can I check what versions I have installed on the system and Flutter? Many thanks
Update
After running brew uninstall dart
when I open the aqueduct project then I get Dart SDK is not configured
message from Android Studio.
If I then point to the Flutter's dart-sdk folder Android Studio accept it but I need a 2.7 version to work well with Aqueduct's Postgres db.
So I guess the system should be set with both Flutter with its own Dart version for Flutter projects and a global Dart version for non Flutter projects like this Aqueduct project.
But then how do I set my path? Should I include both in my .zshrc
file?