toJson method
To be called for a custom json serialization. This is not a chainable call. If the result is writeable by the stringifier, it will result in an exception.
Implementation
@override
dynamic toJson() {
return fold(
(arr) => arr,
(obj) => obj,
);
}