You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice, if in the Mapping Annotation you can define the constructor to use.
class Bar {
final String text;
Bar() : this.text = 'should not be used by mapper';
Bar.useThis(this.text);
}
@Mapper()
class Mapper {
@Mapping(constructor='useThis')
Foo fromBar(Bar source);
}
Generated Mapper should then use the "useThis" constructor.
Right now the first found constructor is used for populating data initially.
It would be nice, if in the Mapping Annotation you can define the constructor to use.
Generated Mapper should then use the "useThis" constructor.
In the future we might use constructor tear off, right now it's not supported by dart and only in the beta.
https://github.com/dart-lang/language/blob/master/accepted/future-releases/constructor-tearoffs/feature-specification.md
The text was updated successfully, but these errors were encountered: