Development Environment Setup¶
Overview¶
This guide provides comprehensive instructions for setting up a development environment for the CulicidaeLab Flutter mobile application. The project supports both containerized development using VS Code Dev Containers and manual local setup.
Prerequisites¶
System Requirements¶
- Operating System: Windows 10/11, macOS 10.14+, or Ubuntu 18.04+
- RAM: Minimum 8GB, recommended 16GB
- Storage: At least 10GB free space for development tools and dependencies
- Network: Stable internet connection for downloading dependencies
Required Tools¶
- Git: Version control system
- VS Code: Recommended IDE with Flutter extensions
- Docker: For containerized development (optional but recommended)
Option 1: Dev Container Setup (Recommended)¶
The easiest way to get started is using the provided Dev Container configuration, which provides a consistent development environment across all platforms.
Prerequisites for Dev Container¶
- Install Docker Desktop
- Windows: Download from Docker Desktop for Windows
- macOS: Download from Docker Desktop for Mac
-
Linux: Follow Docker Engine installation guide
-
Install VS Code
-
Download from Visual Studio Code
-
Install Dev Containers Extension
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Dev Containers" by Microsoft
- Install the extension
Setting Up Dev Container¶
-
Clone the Repository
-
Open in Dev Container
- Open VS Code
- Open the project folder
- VS Code should detect the
.devcontainerconfiguration -
Click "Reopen in Container" when prompted, or:
- Press
Ctrl+Shift+P(Cmd+Shift+P on Mac) - Type "Dev Containers: Reopen in Container"
- Select the command
- Press
-
Wait for Container Build
- The first build may take 10-15 minutes
- Subsequent starts will be much faster
-
The container includes:
- Flutter SDK 3.29.3
- Android SDK with Platform 35
- Android Build Tools 34.0.0
- Android NDK 27.0.12077973
- Java 17
- All necessary development tools
-
Verify Installation
- This should show all checkmarks for Android development
- iOS development will show as unavailable (expected on Linux container)
Dev Container Features¶
The dev container includes:
- Pre-configured Flutter SDK: Latest stable version with Android support
- Android Development Tools: Complete Android SDK, NDK, and build tools
- VS Code Extensions: Flutter, Dart, and helpful development extensions
- USB Device Support: Physical device debugging capabilities
- Port Forwarding: Automatic port forwarding for development servers
Option 2: Manual Local Setup¶
If you prefer to set up the development environment manually or cannot use Docker, follow these platform-specific instructions.
Windows Setup¶
- Install Git
- Download from Git for Windows
-
Use default installation options
-
Install Flutter SDK
# Download Flutter SDK Invoke-WebRequest -Uri "https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.29.3-stable.zip" -OutFile "flutter_sdk.zip" # Extract to C:\flutter Expand-Archive -Path "flutter_sdk.zip" -DestinationPath "C:\" # Add to PATH $env:PATH += ";C:\flutter\bin" [Environment]::SetEnvironmentVariable("PATH", $env:PATH, [EnvironmentVariableTarget]::User) -
Install Android Studio
- Download from Android Studio
- Install with default options
- Open Android Studio and complete the setup wizard
-
Install Android SDK Platform 35 and Build Tools 34.0.0
-
Configure Android SDK
-
Install VS Code and Extensions
- Download VS Code from code.visualstudio.com
- Install Flutter and Dart extensions
macOS Setup¶
-
Install Homebrew (if not already installed)
-
Install Git
-
Install Flutter SDK
-
Install Android Studio
- Download from Android Studio
- Install and complete setup wizard
-
Install required SDK components
-
Install Xcode (for iOS development)
-
Configure Environment
Linux (Ubuntu) Setup¶
-
Update System
-
Install Dependencies
-
Install Flutter SDK
-
Install Android Studio
-
Configure Environment
Project Setup¶
Clone and Initialize¶
-
Clone Repository
-
Install Dependencies
-
Verify Setup
- Resolve any issues shown by flutter doctor
- Ensure Android toolchain shows green checkmark
IDE Configuration¶
VS Code Setup¶
- Install Extensions
- Flutter (Dart-Code.flutter)
- Dart (Dart-Code.dart-code)
- EditorConfig (EditorConfig.EditorConfig)
-
VSCode Icons (vscode-icons-team.vscode-icons)
-
Configure Settings Create
.vscode/settings.json:{ "dart.flutterSdkPath": "/path/to/flutter", "dart.lineLength": 120, "editor.formatOnSave": true, "editor.tabSize": 2, "editor.insertSpaces": true, "editor.detectIndentation": false, "dart.previewFlutterUiGuides": true, "dart.previewFlutterUiGuidesCustomTracking": true, "dart.debugExternalLibraries": false, "dart.debugSdkLibraries": false, "files.autoSave": "afterDelay" }
Android Studio Setup¶
- Install Flutter Plugin
- Go to File → Settings → Plugins
- Search for "Flutter" and install
-
Restart Android Studio
-
Configure SDK Paths
- Go to File → Project Structure
- Verify Android SDK path
- Set Flutter SDK path
Device Setup¶
Android Device Setup¶
Physical Device¶
- Enable Developer Options
- Go to Settings → About Phone
- Tap "Build Number" 7 times
-
Go back to Settings → Developer Options
-
Enable USB Debugging
- In Developer Options, enable "USB Debugging"
- Connect device via USB
-
Accept debugging authorization on device
-
Verify Connection
Android Emulator¶
- Create AVD
- Open Android Studio
- Go to Tools → AVD Manager
- Create Virtual Device
- Choose Pixel 4 or similar
- Select API Level 35 (Android 14)
-
Finish setup
-
Start Emulator
iOS Device Setup (macOS only)¶
Physical Device¶
- Install iOS Development Certificate
- Open Xcode
- Go to Preferences → Accounts
- Add Apple ID
-
Download development certificates
-
Configure Device
- Connect iOS device
- Trust computer on device
- Enable Developer Mode in Settings
iOS Simulator¶
-
Install Simulator
-
Verify Setup
Running the Application¶
Development Mode¶
-
Start Application
-
Debug Mode Features
- Hot reload: Press
rin terminal or save files - Hot restart: Press
Rin terminal - Debug inspector: Press
win terminal
Build Modes¶
-
Debug Build
-
Release Build
-
Profile Build
Troubleshooting¶
Common Issues¶
Flutter Doctor Issues¶
-
Android License Issues
Accept all licenses when prompted. -
Android SDK Not Found
- Verify ANDROID_SDK_ROOT environment variable
-
Ensure Android SDK is installed in correct location
-
Flutter SDK Issues
Build Issues¶
-
Gradle Build Failures
-
Dependency Conflicts
Device Connection Issues¶
-
ADB Issues
-
USB Debugging Not Working
- Try different USB cable
- Enable "File Transfer" mode on device
- Revoke USB debugging authorizations and reconnect
Performance Issues¶
- Slow Build Times
- Increase Gradle memory: Add
org.gradle.jvmargs=-Xmx4gtoandroid/gradle.properties - Use
--no-sound-null-safetyflag if needed -
Clear build cache:
flutter clean -
Hot Reload Not Working
- Ensure you're in debug mode
- Check for syntax errors
- Restart debug session
Development Workflow¶
Recommended Workflow¶
-
Start Development Session
-
Development Cycle
- Make code changes
- Save files (auto hot reload)
- Test changes on device
-
Commit changes with meaningful messages
-
Testing
-
Code Quality
Next Steps¶
After completing the development environment setup:
- Read the Architecture Documentation: Understand the app's structure and patterns
- Review the Project Structure Guide: Learn about directory organization and conventions
- Check the Contributing Guidelines: Understand the development workflow and standards
- Run the Test Suite: Ensure everything is working correctly
- Start with Small Changes: Make a minor change to familiarize yourself with the codebase
Getting Help¶
If you encounter issues during setup:
- Check Flutter Doctor: Run
flutter doctor -vfor detailed diagnostics - Review Logs: Check console output for specific error messages
- Search Documentation: Flutter and Android documentation often have solutions
- Ask for Help: Create an issue in the project repository with:
- Your operating system and version
- Flutter doctor output
- Complete error messages
- Steps you've already tried