TextInputBuffer constructor
Creates a new text input buffer.
initialText sets the starting content (truncated to maxLength if set).
maxLength optionally limits UTF-16 code units and must be non-negative.
Truncation keeps the longest whole-grapheme prefix within that limit.
Implementation
TextInputBuffer({
String initialText = '',
this.maxLength,
}) {
if (maxLength != null && maxLength! < 0) {
throw ArgumentError.value(maxLength, 'maxLength', 'Must be non-negative');
}
setText(initialText);
}