Support createRef fix/assist for usages outside of component classes
Open
Nobody has claimed this yet.
area-analyzer-plugin
- Dominant language
- Dart
- Stars
- 432
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
-
Support replacing callback refs that assign to fields that are local variables (potentially in parent functions) or top-level variables, in addition to class fields
Element divRef; someMethod() { Element spanRef; return (Dom.div()..ref = ((ref) => divRef = ref))( (Dom.span()..ref = ((ref) => spanRef = ref))( ); } -
Suggest
createRefwhen outside of a component class, as a new variable in the closest function bodymethod() { + final divRef = createRef<Element>(); + // some other logic - return Dom.div()(); + return (Dom.div()..ref = divRef)(); }
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is identified; first locate the existing createRef fix/assist implementation and its callback-ref handling. Exercise it with the two Dart examples, covering local and top-level assignments and a suggestion in the closest function body, and verify both transformations are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100