visitText method

  1. @override
void visitText(
  1. TextAst astNode, [
  2. StringBuffer? context
])

Visits all text ASTs.

Implementation

@override
void visitText(TextAst astNode, [StringBuffer? context]) {
  // We must escape any newline characters, '$', and '\' so that the generated
  // message string is valid Dart.
  final text = _escape(astNode.value);
  _hasText = _hasText || text.trim().isNotEmpty;
  _messageBuffer.write(text);
}