toJson abstract method
dynamic
toJson()
Serializes this object instance to JSON format.
This method should convert the object's properties into a JSON-serializable
format (typically a Map<String, dynamic> or a List).
Returns:
A JSON-serializable representation of the object (usually a Map<String, dynamic>
or List, but can be any JSON-serializable type).
Example:
final model = MyModel();
final json = model.toJson(); // {'name': 'John', 'age': 30}
Implementation
dynamic toJson();