nameOf method

String nameOf(
  1. String path
)

The name of path: its last segment when unique, else the path.

Implementation

String nameOf(String path) {
  final last = _last(path);
  return _bySegment[last]!.length == 1 ? last : (path.isEmpty ? '.' : path);
}