prefixNotEmpty method

  1. @useResult
String prefixNotEmpty(
  1. String? value
)

Returns this string with value prepended, or this string unchanged if empty.

Implementation

@useResult
String prefixNotEmpty(String? value) {
  if (isEmpty || value == null || value.isEmpty) {
    return this;
  }

  return value + this;
}