toJson abstract method

Map<String, dynamic> toJson()

Serialises this DTO to JSON. Subclasses tag the output with a type discriminator field so fromJson can route to the right factory.

Implementation

Map<String, dynamic> toJson();