Files
Jonas Finnemann Jensen 50cb703dee Fix hotReload for Flutter in clientside dartpad backend
R=goderbauer
Change-Id: Id704c270ba851b987d84b76c652eb8a1b7ceeafb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508102
Commit-Queue: Michael Goderbauer <goderbauer@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
2026-06-01 07:44:23 -07:00
..

DartPad

package:dartpad is a library for building web applications that enable users to prototype Dart and Flutter in the browser.

This package provides the functionality for running a Dart or Flutter development environment in the browser. By enabling you launch and communicate with:

  • A worker, a dart2wasm compiled Web Worker featuring:
    • An in-memory file system,
    • The Dart LSP server,
    • The Dart Development Compiler (DDC),
    • A subset of dart pub commands for dependency resolution.
  • A Sandbox, an isolated iframe containing bootstrap code necessary to:
    • Run, hot-reload and hot-restart DDC compiled Dart code, and,
    • Proxy console output and unhandled exceptions out of the iframe.

To build a custom dartpad-like experience, you simply have to launch the worker, connect the language server to your editor, compile code and tell the sandbox to run said code, while presenting console output to the user.

Limitations

As of writing there are no support for:

  • Build hooks,
  • Flutter plugins,
  • Flutter assets,
  • Code generation with build_runner.

It might be possible to support some of these features in the future.