transformComponentContent function
Implementation
String transformComponentContent(
String content,
String destinationPath,
String cwd,
) {
final themePath = path.join(cwd, 'lib', 'config', 'theme.dart');
final importPath = calculateThemeImportPath(destinationPath, themePath);
final importRegex = RegExp(
"import\\s+(['\"])(\\.\\.\\/)*config\\/theme\\.dart(['\"]);?",
multiLine: true,
);
final newImport = "import '$importPath';";
return content.replaceAll(importRegex, newImport);
}