appendCharacter method

void appendCharacter(
  1. String character, {
  2. int? maxLength,
})

Implementation

void appendCharacter(String character, {int? maxLength}) {
  if (maxLength != null && text.length >= maxLength) return;
  final String updated = text + character;
  value = TextEditingValue(
    text: updated,
    selection: TextSelection.collapsed(offset: updated.length),
  );
}