clearControllerData method

void clearControllerData()

Clears the text value of all the TextEditingControllers used by the OTP input fields.

This method resets all input fields to empty strings, effectively clearing the OTP inputs.

Implementation

void clearControllerData() {
  for (TextEditingController controller in _controllers) {
    controller.text = '';
  }

  _focusNodes.first.requestFocus();
}