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
@ilpianoforte Does a great job outlining the steps, but I needed to do an additional step for macOS 13.x. So, I thought I would consolidate here.
To install Flutter via Homebrew.
Homebrew/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fvm with Homebrew (this manages multiple versions of Flutter)brew tap leoafarias/fvm
brew install fvm
Flutterfvm install stable
$HOME/fvm/default)fvm global
Flutter to PATH by copying the line below into .zshrc (located in the home directory). IMPORTANT: Make sure to replace [USER_HERE] with your user name.export PATH=$PATH:"$HOME/fvm/default/bin"
.zshrcsource ~/.zshrc
Flutter installation.flutter doctor
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With