netglade / auto_mappr

Code generation for mapping between different objects with ease.
https://pub.dev/packages/auto_mappr
MIT License
71 stars 7 forks source link

Possibility to ignore elements in a list when mapping goes wrong for one element #206

Closed Windisch94 closed 4 months ago

Windisch94 commented 5 months ago

I'd like to convert lets say a list final listA = [correctObject, mappingGoesWrongObject, correctObject] into a list final listB = [correctMappedObject, correctMappedObject]

where i can ignore all elements where the mapping goes wrong. I hope you can get the idea - i haven't seen the possibility to do this in the current implementation.

tenhobi commented 5 months ago

Hi @Windisch94, good idea, we might do it somehow as part of already proposed updates in #204.

petrnymsa commented 4 months ago

Hi @Windisch94 new version just landed with safeMapping. You should be able to filter-out failed mappings.

Closing now, feel free to repoen if you think that safeMapping doesn't cover your needs.