TextEditingEmitter constructor

TextEditingEmitter(
  1. {String text = ''}
)

Implementation

TextEditingEmitter({String text = ''})
    : text = ValueEmitter(text),
      controller = TextEditingController(text: text) {
  _subscription = changes.listen((change) {
    controller.value = controller.value.copyWith(
      text: this.text.value,
      selection: selection.value,
      composing: composing.value,
    );
  });
  controller.addListener(() {
    this.text.value = controller.text;
    selection.value = controller.selection;
    composing.value = controller.value.composing;
  });
}