calculateThemeImportPath function
Implementation
String calculateThemeImportPath(String destinationPath, String themePath) {
final destDir = path.dirname(destinationPath);
final themeDir = path.dirname(themePath);
final relativePath = path.relative(themeDir, from: destDir);
final normalizedPath = path.normalize(relativePath).replaceAll('\\', '/');
if (normalizedPath == '.' || normalizedPath.isEmpty) {
return './theme.dart';
}
if (normalizedPath.startsWith('..')) {
return '$normalizedPath/theme.dart';
}
return './$normalizedPath/theme.dart';
}