htmlEncode function
Implementation
String htmlEncode(String text) {
Map<String, String> mapping = Map.from(
{"&": "&", "<": "<", ">": ">", "'": "'", '"': '"'});
mapping.forEach((key, value) {
text = text.replaceAll(key, value);
});
return text;
}