raspi-flutter is a command-line tool that simplifies the installation and development of Flutter applications on your Raspberry Pi. This Bash script automates the process of setting up the Flutter environment, installs essential files and dependencies, and offers additional features like running your Flutter apps in kiosk mode.
With raspi-flutter, you can effortlessly configure your Raspberry Pi for Flutter app development and create immersive user experiences by running your apps in kiosk mode.
Before running the installer script, ensure you have the following prerequisites:
- Raspberry Pi 4 with Raspberry pi OS 64-bit (Raspbian)
- Bash shell (version 4.0 or higher) - by default is available
- Curl - by default is available
Result-new.mp4
To quickly install raspi-flutter on your Raspberry Pi, open a terminal and simply run the following command:
bash <(curl -fSL https://raw.githubusercontent.com/Snapp-X/raspi-flutter/main/installer.sh) && source ~/.bashrcOnce raspi-flutter is installed on your Raspberry Pi, you can use it by simply running the desired command in your terminal. Here are the available commands:
- doctor: Check the installation status and dependencies.
- install: Install Flutter and set up the environment.
- uninstall: Uninstall Flutter (Note: Uninstallation is not implemented yet).
- kiosk: Run a Flutter app bundle in kiosk mode.
- disable_kiosk: Disable the kiosk mode.
- autologin: Enable auto login on your device.
- disable_autologin: Disable auto login on your device.
For example, to check the installation status, kiosk mode state, and dependencies, simply run:
raspi-flutter doctorThe "install" command in raspi-flutter automates the installation of Flutter on your Raspberry Pi and prepares the environment for Flutter app development. Here's what it does:
-
Installs Linux Dependencies: It ensures that essential Linux packages, such as
curl,git, and more, are installed on your Raspberry Pi. -
Clones Flutter from GitHub: fetches the Flutter repository from GitHub and places it in your specified directory.
-
Sets Up PATH: It configures your system's PATH environment variable to include the Flutter binary directory, making the
fluttercommand globally executable. -
Installs Development Dependencies: it installs necessary Linux development dependencies required for Flutter app development, including compilers and libraries.
-
Chooses Flutter Channel: You can specify your preferred Flutter channel (e.g., stable, beta) to ensure you're using the desired Flutter release.
-
Runs Flutter Doctor: This command checks your Flutter installation and displays any missing components or configuration issues.
-
Precaches Assets: It precaches Linux-specific assets, ensuring a smooth development experience.
To use the "install" command, simply follow the Getting Started section in this README and run:
raspi-flutter installraspi-flutter allows you to run your Flutter app in a kiosk mode on your Raspberry Pi, ensuring a seamless and focused user experience. To enable kiosk mode, follow these steps:
- Build Your Flutter App: Ensure you have built your Flutter app for the Linux platform in release mode. You can use the following command to generate the app bundle:
flutter build linux --release- Enable Kiosk Mode:To run your Flutter app in kiosk mode, use the following command, replacing
<file_path>with the exact path to the Flutter app bundle you built in step 1:
raspi-flutter kiosk <file_path>For example:
raspi-flutter kiosk /home/pi/app/build/linux/arm64/release/bundle/appEnsure that the specified file path exists, points to an executable file, and is the path to your Flutter app bundle.
Auto Login: Kiosk mode typically requires auto login on your Raspberry Pi. If auto login is not already enabled, raspi-flutter will enable it for you.
You can also enable the auto login manually, by using the following command:
raspi-flutter autologinDisable Kiosk Mode (Optional):
To disable the kiosk mode and return your Raspberry Pi to a standard desktop environment, follow these steps:
-
Exit Full-Screen Mode: If your Raspberry Pi is currently in full-screen kiosk mode, you need to exit this mode before disabling kiosk mode. You can typically exit full-screen mode by pressing
Alt+F4(Close the app) orF11(Exit Fullscreen mode). -
Disable Kiosk Mode: Open a terminal on your Raspberry Pi and execute the following command to disable kiosk mode:
raspi-flutter disable_kioskThis command will remove the kiosk-related settings and restore your desktop environment.
Please note that enabling kiosk mode may affect the default behavior of your Raspberry Pi desktop environment. Ensure you have a backup or can access your Raspberry Pi via SSH in case you need to make any adjustments.
If you encounter any issues with the installer script or have suggestions for improvements, please open an issue. You are welcome to contribute to the development of this project by forking the repository and submitting pull requests.
This project is licensed under the MIT License
