toMap method

Map<String, dynamic> toMap(
  1. String rootPath
)

Implementation

Map<String, dynamic> toMap(String rootPath) {
  String originRelativePath = originPath.replaceAll(rootPath, '');
  String obfuscateRelativePath = obfuscatePath.replaceAll(rootPath, '');

  // 去除開頭的/
  if (originRelativePath.startsWith('/')) {
    originRelativePath = originRelativePath.replaceFirst('/', '');
  }
  if (obfuscateRelativePath.startsWith('/')) {
    obfuscateRelativePath = obfuscateRelativePath.replaceFirst('/', '');
  }

  return {
    'originPath': originRelativePath,
    'obfuscatePath': obfuscateRelativePath,
  };
}