initStatus method

  1. @protected
  2. @mustCallSuper
void initStatus()

this method will be called only once in state's lifecircle,immediately called after initState

recommend to init your resources in this method rather than initState

Implementations of this method should start with a call to the inherited method

Implementation

@protected
@mustCallSuper
void initStatus() {
  _currentFocusNode?.addListener(_onFocusChangedListener);
  _status = FormeFieldStatus<T>._(
    enabled: widget.enabled,
    readOnly: widget.readOnly || !widget.enabled,
    validation: _hasAnyValidator && widget.enabled
        ? FormeFieldValidation.waiting
        : FormeFieldValidation.unnecessary,
    value: initialValue,
    hasFocus: _currentFocusNode?.hasFocus ?? false,
  );
}