devcontainer-features icon indicating copy to clipboard operation
devcontainer-features copied to clipboard

feat: Add Flutter SDK devcontainer feature with VS Code extension support

Open Copilot opened this issue 1 month ago • 2 comments

Overview

This PR adds a new Flutter feature to the devcontainer-features collection, enabling developers to easily integrate Flutter development into their devcontainer environments.

Implementation

The Flutter feature installs the Flutter SDK using precompiled binaries from Flutter's official CDN (Google Cloud Storage). This approach ensures fast, reliable installation of official Flutter releases without requiring git operations.

Key Features

  • Version Support: Install either the latest stable version or specify a particular version (e.g., 3.24.5)
  • Installation Location: Flutter SDK installed to /opt/flutter with symlinks to /usr/local/bin for easy access
  • VS Code Integration: Automatically includes the official Flutter VS Code extension (Dart-Code.flutter)
  • Dart SDK: Included as part of Flutter installation
  • Non-root Compatible: Proper permissions set for multi-user environments

Installation Method

The feature downloads precompiled binary archives (tar.xz) from Flutter's official CDN:

  • Downloads from https://storage.googleapis.com/flutter_infra_release/releases/
  • For latest: downloads the stable channel release
  • For specific versions: downloads the specified version archive
  • Includes multiple URL format fallbacks for compatibility
  • Handles SSL verification issues in Docker build environments

Usage Example

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/jsburckhardt/devcontainer-features/flutter:1": {}
    }
}

Or with a specific version:

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/jsburckhardt/devcontainer-features/flutter:1": {
            "version": "3.24.5"
        }
    }
}

Testing

  • Added comprehensive tests verifying Flutter binary installation
  • Integrated into CI/CD pipeline with ubuntu:latest, debian:latest, and devcontainers/base:ubuntu images
  • Tests validate binary existence and proper symlink configuration
  • Global test scenarios include both default and specific version installations

References

  • Flutter Installation Documentation: https://docs.flutter.dev/install/manual
  • Flutter SDK Archive: https://docs.flutter.dev/release/archive
  • VS Code Flutter Extension: https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

Fixes jsburckhardt/devcontainer-features#70

Original prompt

This section details on the original issue you should resolve

<issue_title>Add flutter feature</issue_title> <issue_description>Releases in here: https://github.com/flutter/flutter

Install Instructions in here: https://docs.flutter.dev/install/manual

Extensions (similar to opencode that has extensions): https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes jsburckhardt/devcontainer-features#70


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot avatar Oct 21 '25 07:10 Copilot