We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given the following classes:
class Dog { final String breed; final int age; final String name; Dog(this.breed, this.age, this.name); } class DogModel { final String breed; final int age; final String name; DogModel(this.breed, this.age, this.name); }
And given the following mapper interface:
// dogmapper.dart part 'dogmapper.mapper.g.dart'; @Mapper() abstract class DogMapper { Dog asEntity(DogModel model); }
Instead of generating a mapper class, it would be great to generate mapper extension methods as follows:
// dogmapper.mapper.g.dart extension ConvertibleDogModel on DogModel { Dog get asEntity => Dog(breed, age, name); }
The text was updated successfully, but these errors were encountered:
Hey @mrverdant13 I like the idea, I'm thinking of maybe making this configurable. So that you would be able to write something like
@Mapper(extension: true) ...
And instead of implementing the mapper class, it would generate extension methods like you suggested.
I don't know how much time I'll have in the weeks, but I'll see what I can do. Or if you feel like it, feel free to open a PR
Sorry, something went wrong.
Definitely gonna check this out and try to post a PR.
BTW, thanks for the package! I was about to create one with just similar capabilities! 👀
No branches or pull requests
Description
Given the following classes:
And given the following mapper interface:
Instead of generating a mapper class, it would be great to generate mapper extension methods as follows:
The text was updated successfully, but these errors were encountered: