dartStringLiteral method
Implementation
String dartStringLiteral(String value) {
String escaped = value
.replaceAll(r'\', r'\\')
.replaceAll("'", r"\'")
.replaceAll(r'$', r'\$')
.replaceAll('\n', r'\n')
.replaceAll('\r', r'\r')
.replaceAll('\t', r'\t');
return "'$escaped'";
}