replaceData function
Replaces the keys of data
in input
with the corresponding values.
Implementation
String replaceData(String input, Map<Pattern, dynamic> data) {
var output = input;
for (final entry in data.entries) {
final pattern = entry.key;
final value = entry.value;
output = output.replaceAll(pattern, value.toString());
}
return output;
}