toLiteral method
Converts this string to a literal for embedding it into source code strings.
print(null.toLiteral()) // null
print('Abcd'.toLiteral()) // 'Abcd'
Implementation
String toLiteral() {
if (this == null) {
return 'null';
} else {
return "'${this!.toEscaped()}'";
}
}