tf_2 method

Widget tf_2()

Implementation

Widget tf_2(){
  if(widget.countNumber < 2 ) return SizedBox();

  return TextFieldFastor(
      width: widget.widthOTP,
      padding: EdgeInsets.symmetric(vertical: widget.heightByPadding! ), //to set height
      maxLength: 1,
      textAlign: TextAlign.center,
      focusNode: tf2_node,
      autovalidateMode: tf2_valid,
      decorationBackground: widget.decoration,
      fontSize: widget.fontSize,
      text_color: widget.colorText,
      hint_color: widget.colorHint,
      fontFamily: widget.fontFamily,
      validatorCustom: ValidatorTemplate.equal( 1 ),
      keyboardType: TextInputType.number,
      onChanged: (s){
        //set value
        tf2_txt = s;

        //focus to after check have value
        if( s.length >= 1 ) {
          FocusScope.of(context).requestFocus(tf3_node);
        }

        //focus to previous
        if( s == "" ) {
          FocusScope.of(context).requestFocus(tf1_node);
        }

        //call back
        updateCallBack();
      },
      margin: EdgeInsets.only( right: widget.margin! )
  );
}