๐ FlutterBench - Flutter Development Environment
A comprehensive Flutter development environment with DevContainer templates and project creation tools.
๐งฑ Container Architecture (Layered)
FlutterBench is standardizing on the layered workBenches model:
- Layer 0:
workbench-base:{user} - Layer 1a:
devbench-base:{user} - Layer 2:
flutter-bench:{user}(bench-specific tools)
Legacy Note
Any monolithic .devcontainer/ Dockerfiles are deprecated. The layered images are the source of truth going forward.
๐ฏ Purpose
FlutterBench provides two ways to create Flutter projects with DevContainer support:
- ๐ค Automated Setup - Use
new-flutter-project.shfor quick, standardized project creation - ๐ง Manual Setup - Copy templates manually for maximum customization control
๐ Structure
flutterBench/
โโโ scripts/
โ โโโ new-flutter-project.sh # Automated project creation
โ โโโ new-dartwing-project.sh # DartWing project creation
โ โโโ update-flutter-project.sh # Update existing projects
โ โโโ launch-devbench.sh # Launch development container
โ โโโ start-monster.sh # Container startup script
โโโ templates/
โ โโโ flutter-devcontainer-template/ # DevContainer template
โ โโโ .devcontainer/ # VS Code DevContainer config
โ โโโ .vscode/ # VS Code settings & tasks
โ โโโ scripts/
โ โ โโโ manual-setup-project.sh # Manual setup validation
โ โ โโโ README.md # Script usage guide
โ โโโ .env.example # Environment template
โ โโโ README.md # Template documentation
โโโ docs/ # Additional documentation
๐ Getting Started
Option 1: Automated Setup (Recommended)
Best for: New projects, standardized setup, quick start
# Navigate to flutterBench scripts cd /path/to/workBenches/devBenches/flutterBench/scripts # Create new Flutter project with DevContainer ./new-flutter-project.sh my-flutter-app # Or specify custom target directory ./new-flutter-project.sh my-flutter-app ~/projects/special-projects
What it does automatically:
- โ
Creates Flutter project using
flutter create - โ Copies and configures DevContainer template
- โ
Sets up environment variables (
.env) - โ Configures user UID/GID for proper permissions
- โ Sets up infrastructure paths
- โ Includes specKit for spec-driven development
- โ Ready to open in VS Code
Option 2: Manual Setup (Advanced)
Best for: Existing projects, template customization, learning/understanding
# 1. Create or navigate to your Flutter project flutter create my-flutter-app # or use existing project cd my-flutter-app # 2. Copy template files TEMPLATE_PATH="/path/to/workBenches/devBenches/flutterBench/templates/flutter-devcontainer-template" cp -r "$TEMPLATE_PATH/.devcontainer" . cp -r "$TEMPLATE_PATH/.vscode" . cp -r "$TEMPLATE_PATH/scripts" . cp "$TEMPLATE_PATH/.env.example" . # 3. Set up environment configuration cp .env.example .env # Edit .env file with your project settings... # 4. Validate setup (IMPORTANT!) ./scripts/manual-setup-project.sh
When to use manual setup:
- โ Adding DevContainer to existing Flutter project
- โ Need to customize template before applying
- โ Working with non-standard directory structure
- โ Want to understand how the template works
- โ Debugging container configuration issues
๐ Key Differences
| Feature | Automated Setup | Manual Setup |
|---|---|---|
| Speed | โก Fast (single command) | ๐ข Multiple steps required |
| Control | ๐ฏ Standardized | ๐ง Full customization |
| Validation | โ Built-in | ๐ Manual validation required |
| Learning | ๐ฆ Black box | ๐ Educational |
| Best For | New projects | Existing projects, customization |
| Difficulty | ๐ข Easy | ๐ก Intermediate |
๐ง Manual Setup Validation
โ ๏ธ IMPORTANT: When using manual setup, you MUST run the validation script:
./scripts/manual-setup-project.sh
This script:
- ๐ Creates
.envfrom.env.exampleif missing - โ Validates all required environment variables
- ๐ง Checks variable formats and values
- ๐ณ Verifies Docker environment
- ๐ Tests container configuration
- ๐๏ธ Validates infrastructure paths
๐ For detailed manual setup guidance, see templates/flutter-devcontainer-template/scripts/README.md
๐ก Which Approach Should I Use?
Use Automated Setup when:
- โ Creating a new Flutter project from scratch
- โ You want standard workBenches project structure
- โ You need to get started quickly
- โ You trust the default configuration
- โ You're new to DevContainers
Use Manual Setup when:
- โ Adding DevContainer to existing Flutter project
- โ You need custom template modifications
- โ Working with unique directory structures
- โ You want to learn how DevContainers work
- โ Debugging container issues
- โ You need maximum control over the setup process
โ๏ธ Centralized Configuration Philosophy
Key Principle: The .env file is the single source of truth for ALL project and user-specific configuration.
What This Means:
- โ
Template files remain untouched -
devcontainer.json,docker-compose.yml, etc. are never modified - โ All customization via environment variables - container names, user settings, versions, ports
- โ
Project-specific settings isolated - each project has its own
.envfile - โ Easy template updates - template improvements don't conflict with your settings
Configuration Examples:
# .env file controls everything: PROJECT_NAME=dartwing APP_CONTAINER_SUFFIX=app # Results in: dartwing-app SERVICE_CONTAINER_SUFFIX=gateway # Results in: dartwing-gateway USER_UID=1000 FLUTTER_VERSION=3.24.0 COMPOSE_PROJECT_NAME=dartwingers
Result: Template files use ${PROJECT_NAME}-${APP_CONTAINER_SUFFIX} โ resolves to dartwing-app
๐ Next Steps After Setup
Regardless of which setup method you used:
- Open in VS Code:
code . - Reopen in Container: Click prompt or Ctrl+Shift+P โ "Dev Containers: Reopen in Container"
- Wait for build: First time takes 2-5 minutes
- Start coding: Container includes Flutter SDK, Android tools, and VS Code extensions
๐ง Available Scripts
Project Creation
scripts/new-flutter-project.sh- Create new Flutter project with DevContainerscripts/new-dartwing-project.sh- Create new DartWing project variant
Project Management
scripts/update-flutter-project.sh- Update existing project to latest templatetemplates/.../scripts/manual-setup-project.sh- Validate manual setup
Development Environment
scripts/launch-devbench.sh- Launch development containerscripts/start-monster.sh- Start container infrastructure
๐ Documentation
templates/flutter-devcontainer-template/README.md- Template detailstemplates/flutter-devcontainer-template/scripts/README.md- Manual setup guidedocs/env-file-docker-compose-guide.md- Environment configuration guide
๐ฏ Template Features
The DevContainer template includes:
- ๐ณ Lightweight container (~500MB vs 2GB+ FlutterBench)
- ๐ง Centralized configuration - ALL project and user settings in
.envfile only - ๐ No template file modification - template files remain untouched, use environment variables
- ๐ท๏ธ Configurable container naming - customize app and service container names via
.env - ๐ฑ Shared ADB infrastructure (connects to external ADB server)
- โ๏ธ VS Code integration (tasks, launch configs, extensions)
- ๐๏ธ Proper user permissions (UID/GID matching)
- ๐ Hot reload support (port forwarding configured)
- ๐งช Testing support (launch configurations)
- ๐ Spec-driven development (includes specKit)
๐๏ธ Container Philosophy
- FlutterBench = Heavy development workbench (~2GB, all tools)
- Project Containers = Lightweight project-specific environment (~500MB)
Use FlutterBench for heavy development, project containers for debugging and light development.