The name of path: its last segment when unique, else the path.
path
String nameOf(String path) { final last = _last(path); return _bySegment[last]!.length == 1 ? last : (path.isEmpty ? '.' : path); }