textWithCursor method
Returns the text with a cursor indicator at the current position.
cursorChar is the character to show at cursor (e.g., '▌', '|', '_').
showCursor can be toggled for blinking effect.
Implementation
String textWithCursor({
String cursorChar = '▌',
bool showCursor = true,
}) {
if (!showCursor) return text;
final before = textBeforeCursor;
final after = textAfterCursor;
return '$before$cursorChar$after';
}