toJson method
Converts the state to a JSON map.
Returns:
- A Map<String, dynamic> representing the state in JSON format.
Implementation
@override
Map<String, dynamic> toJson() {
return {
"type": "error",
"message": message,
"code": code,
"originalData": originalData?.toJson(),
};
}