onTextChange method

void onTextChange(
  1. void callback(
    1. String
    )
)

Implementation

void onTextChange(void Function(String) callback) {
  if (input != null) {
    if (input?.tagName == "INPUT") {
      input?.onInput.listen((event) {
        callback((input as HTMLInputElement).value);
      });
    }

    if (input?.tagName == "TEXTAREA") {
      input?.onInput.listen((event) {
        callback((input as HTMLTextAreaElement).value);
      });
    }
  }
}