setup-frontend.sh
Automates the complete Flutter frontend setup process.
Purpose
Sets up the Flutter development environment by verifying installation, fetching dependencies, and enabling desktop support for your platform.
Location
Must be run from the scripts/ directory:
cd scripts
./setup-frontend.sh
What It Does
- Validates Flutter installation - Checks Flutter SDK and runs
flutter doctor - Installs dependencies - Runs
flutter pub get - Enables platform support - Configures desktop support for Linux/macOS/Windows
- Cleans previous builds - Runs
flutter cleanto ensure a fresh start
Prerequisites
- Flutter SDK 3.10 or higher
- Platform-specific tools:
- Linux:
libgtk-3-dev,libblkid-dev,liblzma-dev - macOS: Xcode Command Line Tools
- Windows: Visual Studio 2022 with C++ tools
- Linux:
Output
On success, displays:
✓ Flutter 3.x.x (channel stable)
✓ Dependencies installed successfully
Frontend Setup Complete!
Next Steps
After running this script:
-
Start the frontend:
./start-frontend.sh
# or
./start-dev.sh # starts both backend and frontend -
Or build for release:
cd ../frontend
flutter build linux # or macos, windows, apk, ios
Platform Detection
The script automatically detects your platform:
- Linux: Enables Linux desktop support
- macOS: Enables macOS desktop support
- Windows: Enables Windows desktop support
Linux Dependencies
On Linux, you may need to install additional packages:
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
The script will display a reminder if these are needed.
Troubleshooting
Flutter not found
Add Flutter to your PATH:
export PATH="$PATH:/path/to/flutter/bin"
# Add to ~/.bashrc or ~/.zshrc to persist
flutter doctor issues
Run and fix reported issues:
flutter doctor
Common fixes:
- Android: Install Android Studio
- iOS: Install Xcode (macOS only)
- Linux: Install GTK development libraries
Dependencies conflict
cd frontend
flutter clean
flutter pub get
Source Code
Located at: scripts/setup-frontend.sh
Key features:
- Platform auto-detection
- Color-coded output
flutter doctorhealth check- Automatic desktop enablement