timestamp property

int? timestamp

Returns the value of the timestamp field in milliseconds since January 1st, 1970 at 00:00:00 UTC

Implementation

int? get timestamp {
  final field = getField(TimestampField.ID);
  if (field != null && field.isValid()) {
    var subField = field.getValidSubField(fields);
    return field.getValue(subField: subField);
  } else {
    return null;
  }
}
void timestamp=(int? value)

Sets the timestamp field. value is milliseconds since January 1st, 1970 at 00:00:00 UTC. Throws FieldNotDefinedError if the field is not defined in the message.

Implementation

set timestamp(int? value) {
  final field = getField(TimestampField.ID);

  if (field != null) {
    if (value == null) {
      field.clear();
    } else {
      var subField = field.getValidSubField(fields);
      field.setValue(0, value, subField);
    }
  } else {
    throw FieldNotDefinedError(field!.name);
  }
}