addTrailingSlash function

String addTrailingSlash(
  1. String path
)

Adds a trailing slash to the path if it does not have one.

Implementation

String addTrailingSlash(String path) {
  if (!path.endsWith(kPathSeparator)) {
    return '$path$kPathSeparator';
  }
  return path;
}