Skip to content

feat: allow exclude fields from toJson and toMap#236

Open
stact wants to merge 2 commits intoschultek:mainfrom
stact:allow-ignore-fields
Open

feat: allow exclude fields from toJson and toMap#236
stact wants to merge 2 commits intoschultek:mainfrom
stact:allow-ignore-fields

Conversation

@stact
Copy link

@stact stact commented Sep 23, 2024

Please find this PR to allow exclude fields from toJson and toMap.
I used the same logic as ignoreNull.

You will be able to add ignore: ['key1', 'key2']on MappableClass

I will need help for managing the tests.

Related to: #105

@hatch01
Copy link
Contributor

hatch01 commented Aug 30, 2025

Hi, why is this PR stuck here with no comment or merged.
This functionality would be very useful.

@hatch01
Copy link
Contributor

hatch01 commented Aug 31, 2025

In my personal case, I also needed to ignore the fields in the import methods.
https://github.com/hatch01/dart_mappable/ if it can help someone.
I'll try to stay as up-to-date as I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants