DanTup · GitHub

v2.3.1 includes a preview feature enabled with the dart.previewFlutterCloseTagDecorations: true setting. This adds "closing tag" decorations to the closing parens of constructor calls within build methods.

This feature is behind a flag because it's incomplete, has sub-optimal performance and may not work reliably. It is being shipped solely for feedback on the idea and may require analyzer work in order to support in a reliable way.

Please post your feedback below!

Flutter closing tag decorations

Known issues:

These are things that (probably) can't be addressed without support from the analyzer.

  • [Perf] Doesn't scale well due to reliance on Outlines, Highlights and repeated getHover calls
  • Currently identifies build methods based on return type string (Widget)
  • Only shows constructors, doesn't show end of lists (children, actions)

Suggestions:

These are things that can be improved in the preview.

  • Support const as well as new
  • Prefix with // instead of / so looks a bit like a comment marking the end
  • Improve styling
  • Fix flicker when typing quickly (or holding keys) caused by not being able relate analyzer notifications with document versions - just keep resetting a timeout and only update after there's been no update for x milliseconds (where x > expected latency for the update)
  • Show decorations in any Widget-returning method
  • Don't show annotations against characters other than ) to mitigate out-of-sync notifications
  • Allow color to be customised rather than reusing an existing style

Read the original on github.com ↗