toStringWithDefault static method

String toStringWithDefault(
  1. dynamic value,
  2. String defaultValue
)

Converts value into string or returns default when value is null.

  • value the value to convert.
  • defaultValue the default value. Returns string value or default when value is null.

See toNullableString

Implementation

static String toStringWithDefault(value, String defaultValue) {
  var result = StringConverter.toNullableString(value);
  return result ?? defaultValue;
}