value property

  1. @override
DateTime get value
override

Gets the value of the JSON date field.

Returns:

  • The DateTime value, or the current date and time if the value is null.

Implementation

@override
DateTime get value {
  return rawValue ?? DateTime.now();
}
  1. @override
set value (dynamic value)
override

Sets the value of the JSON date field.

Parameters:

  • value: The new value of the field.

Implementation

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