I would like to install Flutter on my Apple M1 machine using Homebrew. But I am a bit hesitant because I am not sure if this will provide any benefits or it will create more trouble (e.g. permission issues). An alternative way would to be install Flutter using its installer from its docs.
My question is, is there a recommended way to install Flutter on an Apple M1 macbook? I could not find any docs regarding installing Flutter using Homebrew.
I ended up installing Flutter in with the following steps:
Homebrew
(if you dont already have)* - install Homebrew/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fvm
using Homebrew
- install fvmbrew tap leoafarias/fvm
brew install fvm
flutter
version through fvm
- fvm documentationfvm install stable # Installs latest stable version of flutter
fvm doctor
to ensure it is installedfvm global stable # sets your default flutter to the installed stable version
/Users/<YOUR_USER>/fvm/default/bin
. In that case from the root of your user:nano .zshrc
.zshrc
file:export PATH="$PATH:/Users/<YOUR_USER>/fvm/default/bin"
Then save (control + o
) then hit enter and then exit (control + x
)
Close and reopen your terminal and check the flutter installation with fvm flutter --version
Run fvm flutter doctor
to resolve and install any missing components
fvm flutter doctor
had such a warning:! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.1.5/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/<YOUR_USER>/fvm/versions/stable. Consider adding /Users/<YOUR_USER>/fvm/versions/stable/bin to the front of your path.
You can resolve it by uninstalling dart
from brew
since flutter sdks are shipped already with dart:
brew uninstall dart