setProperty method

  1. @override
void setProperty(
  1. String name,
  2. Object? value
)
override

Set the value of the property with the given name to the given value. If the value is null, the property will effectively be removed.

Implementation

@override
void setProperty(String name, Object? value) {
  if (value == null) {
    final propertyMap = _propertyMap;
    if (propertyMap != null) {
      propertyMap.remove(name);
      if (propertyMap.isEmpty) {
        _propertyMap = null;
      }
    }
  } else {
    (_propertyMap ??= HashMap<String, Object>())[name] = value;
  }
}