trParams method
Returns a translated string with parameters replaced.
params
is a map where keys represent parameter placeholders in the translated string (e.g., '@key') and values represent the replacement strings.
Implementation
String trParams([Map<String, String> params = const <String, String>{}]) {
String trans = tr;
if (params.isNotEmpty) {
params.forEach((String key, String value) {
trans = trans.replaceAll("@$key", value);
});
}
return trans;
}