posixRelativeImportUri static method
Dart import URI from fromFile to toFile, both app-root relative.
Implementation
static String posixRelativeImportUri({
required String fromFile,
required String toFile,
}) {
final fromDir = p.posix.dirname(fromFile.replaceAll('\\', '/'));
final relative = p.posix.relative(
p.posix.normalize(toFile.replaceAll('\\', '/')),
from: fromDir,
);
return relative.startsWith('.') ? relative : './$relative';
}