Offer code assist for constructing new arguments
See original GitHub issueThe autocomplete to fill in the <Widget>[] list literal on children parameters is super awesome.
I wonder if we can apply it to all parameters by checking against the analyzer.
Consider I’m starting to type
return new PageRouteBuilder(
pageBuilder: <highlight>pageBuilder</highlight>
)
Now it’s a huge pain to actually fill out my selected value with a new instance of what pageBuilder
the parameter wants unless I already have an instance.
Would be nice for the code assist on the selected string to offer the construction of the type the parameter wants. In this case, a function with a long list of input parameters that would autocomplete to:
return new PageRouteBuilder(
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
return <highlight></highlight>
},
)
Here the parameter takes a function that can only be constructed one way but it would be nice for the code assist to offer all the constructors.
So on a children
parameter, it can offer a <Widget> list literal or offer new List, new List.filled, new List.from etc from all the factories correctly parametrized.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
See https://github.com/dart-lang/sdk/issues/31885.
Closing this since I think it’s all analyzer work (https://github.com/dart-lang/sdk/issues/31885). We can revisit if anything gets implemented that needs additional support in Dart Code though.