comment property
String?
comment
Retrieves the first comment.
Returns the value of the first comment. In the unlikely situation where there are more than one comment, the rest are ignored.
Returns null if there is no comment property.
Implementation
String? get comment {
final values = _data[commentName];
if (values != null) {
return values.first; // has comment
} else {
return null; // no comment: deliberately return null
}
}
Sets the properties to have a comment.
Sets the comment property to the given value
. All previous comment
properties are removed, if there was any.
If the value is null, no new comment property is added. So the properties will not have any comment properties.
Implementation
set comment(String? value) {
if (value != null) {
_data[commentName] = [value]; // set all to just the one value
} else {
_data.remove(commentName); // remove all
}
}