auto_mappr icon indicating copy to clipboard operation
auto_mappr copied to clipboard

Field mapping does not work with Constructor parameters properly

Open petrnymsa opened this issue 9 months ago • 1 comments

Describe the bug If I have custom constructor selected via "constructor" and this constructor has parameter named differently than backing field, mapping does not wrok

To Reproduce

class Source {
  int a;
}

class Target {
   int secret;

  Target.foo({required a}) : this.secret = a;
}

Without explicit mapping

Field('a', from: 'a') 

mapper will not generate proper mapping although it should


**Version info**
 - Package version : 1.9.0

petrnymsa avatar May 29 '25 11:05 petrnymsa

we should also concider targetConstructor vs sourceConstructor when reverse: true

tenhobi avatar May 29 '25 12:05 tenhobi