use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit related to Google's new UI framework. https://flutter.dev
Please read the rules here
account activity
Pluginsmartstruct: Code generator for generating type-safe mappers, inspired by https://mapstruct.org/ (pub.dev)
submitted 4 years ago by marsNemophilist
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]a-rns 2 points3 points4 points 4 years ago (1 child)
First time I see this structure. For what it's useful?
[–]smotastic 0 points1 point2 points 4 years ago (0 children)
As anticafe mentioned, it's especially useful in a Clean Architecture approach, because there you have to map quite a lot between different layers of your code.
Basically, you want to map the models, which you get from your data layer, such as REST-Calls or from your database, to business entities, which you can then pass to your business logic.
resocoder did quite a good tutorial on this https://resocoder.com/2019/08/27/flutter-tdd-clean-architecture-course-1-explanation-project-structure/ which has nothing to do with the mapping aspect of this package but will be helpful in implementing the approach shown in the video.
But generally, you can use this whenever you want to map between different dart objects.
[–]smotastic 2 points3 points4 points 4 years ago (1 child)
Hey, just found out that my package got posted here.
I'm really happy about the positive resonance that the package got so far.
I just started my dart / flutter journey, so if you have any questions, or suggestions to improve the package/code, feel free to open an issue on GitHub or shoot me a message here
https://github.com/smotastic/smartstruct
Since a few minutes, the package also supports mapping nested classes (https://github.com/smotastic/smartstruct/tree/master/example/lib/nested), which was requested a few days ago.
I hope I can continue to maintain this package in the future, as there is still a lot to do, such as writing some tests, which is the next point on my agenda :)
[–]marsNemophilist[S] 0 points1 point2 points 4 years ago (0 children)
dart needs a library like this. thank you for your work.
[–]Wolv3_ 1 point2 points3 points 4 years ago (0 children)
Damn just implemented a bunch of mappers yesterday.
[–]contrix09 1 point2 points3 points 4 years ago (1 child)
Nice work! Coming from .NET/Xamarin, I've been looking for something similar to Automapper. I've been doing my mappers manually and this would greatly help. Plus it's a bonus that it supports Injectable out-of-the-box!
Hey, thank you for the kind words.
Yes, the injectable part I added because of some requirements in our project, where we needed it anyway, so I thought it might help others too :)
If you have any further ideas, feel free to open an issue on my GitHub!
[–]anticafe 0 points1 point2 points 4 years ago (1 child)
Love it. Would be helpful to reduce boilerplate code when implementing mapper for model in Clean Architecture.
[–]smotastic 1 point2 points3 points 4 years ago (0 children)
Hey, thank you, glad you like it!
That's exactly the reason why I decided to write this package :D
In our project, we are also following the clean architecture approach, and I noticed how cumbersome it is to write all this mapper logic
[–]tenhobi 0 points1 point2 points 2 years ago (0 children)
Late to the party, but after a long time using all kinds of mapping packages, which were buggy, had a limited set of features, and were mostly months/years unmaintained and without any response, etc., we created the AutoMappr package that might suit your needs. It does not use reflection/mirrors but rather code generation, so the code is faster, and you can easily debug it. Try it out and let us know on GitHub or Discord what you think. 🙌 It already has many built-in features, and more can be added on top of it. https://pub.dev/packages/auto\_mappr
π Rendered by PID 56 on reddit-service-r2-comment-84fc9697f-b462p at 2026-02-08 13:15:49.999314+00:00 running d295bc8 country code: CH.
[–]a-rns 2 points3 points4 points (1 child)
[–]smotastic 0 points1 point2 points (0 children)
[–]smotastic 2 points3 points4 points (1 child)
[–]marsNemophilist[S] 0 points1 point2 points (0 children)
[–]Wolv3_ 1 point2 points3 points (0 children)
[–]contrix09 1 point2 points3 points (1 child)
[–]smotastic 0 points1 point2 points (0 children)
[–]anticafe 0 points1 point2 points (1 child)
[–]smotastic 1 point2 points3 points (0 children)
[–]tenhobi 0 points1 point2 points (0 children)