extractKeys function
Implementation
Map<String, String> extractKeys(String content) {
print('📌 Input file loaded (${content.length} chars)');
final regex = RegExp(
r'''static\s+(?:const\s+)?(?:String\s+)?([A-Za-z_]\w*)\s*=\s*(?:'([^']*)'|"([^"]*)");''',
multiLine: true,
);
final matches = regex.allMatches(content);
final keys = <String, String>{};
for (final m in matches) {
final key = m.group(1)!;
final value = m.group(2) ?? m.group(3) ?? '';
keys[key] = value;
}
// ✅ Always return keys, even if empty
return keys;
}