relativeOf method
absolute relative to root, or null when it is outside it.
Implementation
String? relativeOf(String absolute) {
final a = _resolveDots(absolute);
if (samePath(a, root)) return '';
final prefix = root.endsWith('/') ? root : '$root/';
final head = a.length >= prefix.length
? a.substring(0, prefix.length)
: null;
if (head == null || !samePath(head, prefix)) return null;
return a.substring(prefix.length);
}