postProcessJson method

Map<String, dynamic> postProcessJson(
  1. Map<String, dynamic> json,
  2. SerializationContext context
)

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 map
  • context: 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;
}