Google is committed to advancing racial equity for Black communities. See how.

doubleProperty method

DoubleProperty doubleProperty (String name)

Returns a DoubleProperty with name on this node.

If a DoubleProperty with name already exists and is not deleted, this method returns it.

Otherwise, it creates a new property initialized to 0.0.

Throws InspectStateError if a non-deleted property with name already exists but it is not a DoubleProperty.

Implementation

DoubleProperty doubleProperty(String name) {
  if (_writer == null) {
    return DoubleProperty.deleted();
  }
  if (_properties.containsKey(name)) {
    if (_properties[name] is! DoubleProperty) {
      throw InspectStateError("Can't create DoubleProperty named $name;"
          ' a different type exists.');
    }
    return _properties[name];
  }
  return _properties[name] = DoubleProperty._(name, this, _writer);
}