replacePlaceholders method

String replacePlaceholders(
  1. String value,
  2. Map<String, String> properties
)

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]);
}