getRelativePath function

String getRelativePath(
  1. String absolutePath,
  2. String basePath
)

Implementation

String getRelativePath(String absolutePath, String basePath) {
  var result = absolutePath.replaceFirst(basePath, '');
  if (result.startsWith('/')) {
    result = result.replaceFirst('/', '');
  }
  return result;
}