postProcessJson method
Override to add custom post-processing for specific models.
This method is called after all standard processing is complete, allowing you to add custom logic for specific serialization contexts.
Parameters:
json: The processed JSON mapcontext: The serialization context
Returns: The modified JSON map
Example:
@override
Map<String, dynamic> postProcessJson(
Map<String, dynamic> json,
SerializationContext context,
) {
if (context == SerializationContext.firestore) {
json['_version'] = 1;
}
return json;
}
Implementation
Map<String, dynamic> postProcessJson(
Map<String, dynamic> json,
SerializationContext context,
) {
return json;
}