codeUpdated method

  1. @override
void codeUpdated()
override

Called when a new OTP code is received through autofill.

This override is triggered automatically when the system detects a new OTP code (for example, from an SMS message). If autofill is enabled (enableAutoFill) and the field itself is active (enabled), the received code is passed to the handleText method to update the input UI.

Implementation

@override
void codeUpdated() {
  if (widget.enableAutoFill && widget.enabled == true) {
    _handleText(text: code ?? '');
  }
}