resolve method
Resolve all {{...}} placeholders in value using context.
Nested keys use dot notation (e.g. user.name).
Implementation
String resolve(String value, Map<String, dynamic>? context) {
if (value.isEmpty) return value;
if (context == null || context.isEmpty) {
return value.replaceAllMapped(_placeholderPattern, (_) => missingKeyFallback);
}
return value.replaceAllMapped(_placeholderPattern, (match) {
final key = match.group(1)?.trim() ?? '';
return _getNested(context, key) ?? missingKeyFallback;
});
}