Open
Description
Dart VM version: 2.1.0-dev.9.4.flutter-f9ebf21297 (Thu Nov 8 23:00:07 2018 +0100) on "linux_x64"
When using an IDE, when an argument of a certain type is required, classes with static getters or constants of that type could be suggested, for example:
class A {
final bool belongsToB;
const A({this.belongsToB});
}
class B {
static const A staticMember = A(belongsToB: true);
}
void fnThatNeedsA({A obj}) {}
void main() {
fnThatNeedsA(obj: );
// ^
}
Here, B.staticMember
should be an autocomplete suggestion.
See this Flutter example:
ThemeData(
primarySwatch:
)
The IDE suggests MaterialColor(
, but what the user probably needs is Colors.
, so this should be the first suggestion. (primarySwatch
is of type MaterialColor
and the Colors
class includes many static constants of type MaterialColor
).
Originally filed in Dart-Code/Dart-Code#1375