toJSON method
Converts the double field to a JSON-compatible format.
Returns the underlying rawValue, which can be a double
or null
.
This method is used during serialization to include the field in the JSON output.
Example:
JsonDouble priceField = JsonDouble("price");
priceField.value = 19.99;
Map<String, dynamic> json = {"price": priceField.toJSON()}; // {"price": 19.99}
Implementation
@override
double? toJSON() {
return rawValue;
}