value property

  1. @override
num get value
override

Gets the value of the JSON number field.

Returns:

  • The numeric value, or 0 if the value is null.

Implementation

@override
num get value => rawValue ?? 0;
  1. @override
set value (dynamic value)
override

Sets the value of the JSON number field.

Parameters:

  • value: The new value of the field.

Implementation

@override
set value(dynamic value) {
  if (value is num?) {
    rawValue = value;
    return;
  }
  if (value is String) {
    rawValue = num.tryParse(value);
    return;
  }
}