Skip to content

Conversation

@helin24
Copy link
Member

@helin24 helin24 commented Nov 3, 2025

Follow up to #8595

At the moment I don't see consequences to having or not having the DTD connection, but I expect that in the future, the widget preview will respond to theme change updates over DTD. (and potentially other things?)

Based on the conversation in #8595 (comment), the DevTools URI also does not have a visible consequence, but it should prevent flutter tools from starting its own DevTools instance when widget-preview is run.

@helin24 helin24 requested review from bkonyi, jwren and pq November 3, 2025 21:15
@bkonyi
Copy link

bkonyi commented Nov 3, 2025

At the moment I don't see consequences to having or not having the DTD connection, but I expect that in the future, the widget preview will respond to theme change updates over DTD. (and potentially other things?)

If not given a DTD URI for the DTD instance hosted by the IDE, the widget previewer won't be able to respond to editor events (e.g., changing the set of previews displayed based on the currently selected file, responding to theme change events, etc), which would significantly reduce the UX when using the previewer embedded in the IDE.

@helin24
Copy link
Member Author

helin24 commented Nov 4, 2025

@bkonyi and I discussed a little further and decided I'll try to implement editor service RPCs in the plugin:

  • navigateToCode
  • getActiveLocation

And the events:

  • activeLocationChanged
  • themeChanged (this is lower priority)

They'll be in upcoming PRs if easy to do. Otherwise we'll decide where to prioritize.

@helin24 helin24 merged commit 810aabe into flutter:main Nov 4, 2025
7 checks passed
@helin24 helin24 deleted the widget-preview-dtd branch November 4, 2025 18:59
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.

4 participants