valueToString method

  1. @override
String valueToString()
override

Returns a string representation of the property value.

Subclasses should override this method instead of toDescription to customize how property values are converted to strings.

Implementation

@override
String valueToString() {
  String? text = description ?? value;

  if (quoted && text != null) {
    // An empty value would not appear empty after being surrounded with
    // quotes so we have to handle this case separately.
    if (ifEmpty != null && text.isEmpty) {
      return ifEmpty!;
    }
    return '"$text"';
  }
  return text.toString();
}