convertRelativePath method
Implementation
@override
String convertRelativePath(int rootId, String path) {
var instanceContext = getLoadContext(rootId);
if (instanceContext != null && path.startsWith("hpfile://")) {
var relativePath = path.replaceFirst("hpfile://./", "");
var bundleLoaderPath = instanceContext.bundleLoader?.path;
if (bundleLoaderPath != null) {
path = bundleLoaderPath.substring(
0, bundleLoaderPath.lastIndexOf(Platform.pathSeparator) + 1) +
relativePath;
}
}
return path;
}