getDisplayName static method

String getDisplayName(
  1. String nameOrPath
)

Implementation

static String getDisplayName(String nameOrPath) {
  if (nameOrPath.contains('/')) {
    List names = nameOrPath.split('/');
    nameOrPath = names.removeLast();
    while (nameOrPath == '' && names.isNotEmpty) {
      nameOrPath = names.removeLast();
    }
  }

  if (nameOrPath.contains('%')) {
    nameOrPath = UriComponentDecoder.decode(nameOrPath);
  }

  return nameOrPath;
}