toJson method
Serializes the double value to JSON format.
Returns the raw double value, which may be null if no value has been
set. This allows the JSON representation to distinguish between an
explicitly set 0.0 value and an unset (null) value.
Returns:
The double value, or null if no value has been set.
Example:
final field = JsonDouble('price');
print(field.toJson()); // null
field.value = 19.99;
print(field.toJson()); // 19.99
field.value = 0.0;
print(field.toJson()); // 0.0
Implementation
@override
double? toJson() {
return rawValue;
}