replacePlaceholders method
Replaces all #{name}
-style placeholders in value
using the given properties
map.
Example
final result = helper.replacePlaceholders('Hello \#{user}!', {'user': 'Alice'});
print(result); // Output: Hello Alice!
If a placeholder is not found and ignoreUnresolvablePlaceholders
is false, an error will be thrown.
Implementation
///
/// ### Example
/// ```dart
/// final result = helper.replacePlaceholders('Hello \#{user}!', {'user': 'Alice'});
/// print(result); // Output: Hello Alice!
/// ```
///
/// If a placeholder is not found and `ignoreUnresolvablePlaceholders` is false, an error will be thrown.
String replacePlaceholders(String value, final Map<String, String> properties) {
return replacePlaceholdersWithResolver(value, (key) => properties[key]);
}