cleanImport function

String cleanImport(
  1. String basePath,
  2. Uri uri
)

Implementation

String cleanImport(String basePath, Uri uri) {
  final str = uri.toString();
  if (str.startsWith('asset')) {
    return str.substring(
      // + 1 for last '/'
      str.indexOf(basePath) + basePath.length + 1,
    );
  } else {
    return str;
  }
}