How can I ignore a key when using json.encode
?
Something like this:
final map = json.decode(json.encode(routine), reviver: (key, value) {
if (key == "id") {
return null;
}
return value;
});
But this way my map has a key id
with value null
. I want my map to not have the id key.
Any Idea?