Skip to content

feat(widget_preview): add Flutter widget preview support - #542

Merged
sidlatau merged 1 commit into
mainfrom
feat/widget-preview
Sep 25, 2026
Merged

sidlatau merged 1 commit into
mainfrom
feat/widget-preview

Conversation

@sidlatau

Copy link
Copy Markdown
Collaborator

Closes #499

  • :FlutterWidgetPreview [dir] runs flutter widget-preview start from the project (or pub workspace) root, or re-opens a running preview; :FlutterWidgetPreviewStop stops it.
  • Starts a Dart Tooling Daemon and attaches dartls to it, waiting for its first analysis, so the previewer reuses the editor's analysis server instead of spawning a second one.
  • Registers the DTD Editor service like Dart-Code: the previewer's "filter by selected file" follows the current buffer, and inspector / stack trace selections jump to the code.
  • Uses Flutter's hidden --machine and --dtd-url flags (same as Dart-Code) and Neovim 0.12 progress messages; the command refuses to run on older Neovim.

- `:FlutterWidgetPreview [dir]` starts `flutter widget-preview start` (or re-opens it) and `:FlutterWidgetPreviewStop` stops it
- Starts a Dart Tooling Daemon, attaches dartls to it and waits for its first analysis, so the previewer reuses the editor's analysis server
- Provides the DTD `Editor` service: the previewer follows the current buffer and inspector / stack trace selections jump to the code
- Requires Neovim 0.12+ for progress messages
@sidlatau
sidlatau merged commit 3d061f8 into main Sep 25, 2026
3 checks passed
@sidlatau
sidlatau deleted the feat/widget-preview branch September 25, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Adding Flutter Widget Previewer.

1 participant