singleQuote function

String singleQuote(
  1. String input
)

Returns input surrounded by single quotes and with all '$'s escaped.

Implementation

String singleQuote(String input) {
  return "'${input.replaceAll(r'$', r'\$')}'";
}