insertText method

void insertText(
  1. String text
)

Inserts text at the current cursor location.

Implementation

void insertText(String text) {
  if (text.isEmpty) return;
  final before = _TextAreaControllerSnapshot.capture(_model);
  _model.insertString(text);
  if (!before.matches(_model)) {
    notifyListeners();
  }
}