smotastic / smartstruct

Dart Code Generator for generating mapper classes
35 stars 20 forks source link

Feat/optional static mapping #76

Open petrnymsa opened 2 years ago

petrnymsa commented 2 years ago

This PR adds new parameter to Mapper() annotation to optionally turn off "Static mapping".

In our project, we usually have "statci helper methods" to map the inner fields of complex objects, but such methods are only for mapping. Without this feature, for each static method a new static $_method is generated which often is not needed and moreover, sometimes it leads to compile errors.

Breaking change: NO - as this parameter is by default set to true

petrnymsa commented 1 year ago

Hi @smotastic do you think that this feature is helpful? In our project we would like to have it