Flutter

Installation (Archlinux)

  1. Install flutter
yay -S flutter
  1. You then need to adjust the permissions of the binary and install folder so that we can run stuff as our user:
sudo groupadd flutterusers
sudo gpasswd -a $USER flutterusers
sudo chown -R :flutterusers /usr/lib/flutter
sudo chmod -R g+w /usr/lib/flutter
sudo chown -R :flutterusers /bin/flutter
sudo chmod -R g+w /bin/flutter
  1. Android -> Install the necessary packages:
yay -S android-sdk android-sdk-platform-tools android-sdk-build-tools
yay -S android-platform
  1. And also fix the permissions
sudo groupadd android-sdk
sudo gpasswd -a $USER android-sdk
sudo setfacl -R -m g:android-sdk:rwx /opt/android-sdk
sudo setfacl -d -m g:android-sdk:rwX /opt/android-sdk
  1. You’ll probably also have to set up environment variables for ANDROID_SDK_ROOT and JAVA_HOME.

The Java version is under /usr/lib/jvm, in the case of version 8, it’s this:

export JAVA_HOME='/usr/lib/jvm/java-8-openjdk'

Usage

Check installation

To check if flutter is correctly installed:

flutter doctor

Run the app locally

To run the app on linux:

flutter run

to use Hot Reload while running the app, you need to focus the terminal running the app and press r.

Alternatively, use dashmon

To install it, run :

flutter pub global activate dashmon

and substitute flutter run with dashmon.

More information in the package page.

Projects

Project structure

Configuration

main.dart

↑ Back to the top