addPrefix method

String addPrefix(
  1. String prefix
)

If this string starts with the given prefix, returns this string. Otherwise, returns a copy of this string after adding the prefix.

Implementation

String addPrefix(String prefix) => startsWith(prefix) ? this : "$prefix$this";