toMap method
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,
};
}