This quickstart for Flutter on Arch Linux is based on this tutorial.
Prerequisites
- yay
Install dart
yay -S dart
Check the dart installation with:
dart --version
Install android tools
yay -S android-tools
Install Flutter
yay -S flutter
Check flutter installation with:
flutter --version
Install Visual Studio Code extension
Install the Flutter extension in Visual Studio Code
Check installation
flutter doctor
In my case, this was the output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel , 3.19.5, on Manjaro Linux 6.8.6-1-MANJARO, locale de_DE.UTF-8)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed
instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] Connected device (1 available)
[✓] Network resources
! Doctor found issues in 3 categories.
For Flutter-Web development, the environment variable CHROME_EXECUTABLE
must point to the Chrome executable. Best place an environment variable in /etc/environment
:
# For Flutter
CHROME_EXECUTABLE=google-chrome-stable
Conclusion
With this setup, you should be able to develop Flutter Apps for the Desktop and the Web on Arch Linux.