PinInputTextField constructor

PinInputTextField(
  1. {Key key,
  2. int pinLength = _kDefaultPinLength,
  3. ValueChanged<String> onSubmit,
  4. PinDecoration decoration = _kDefaultDecoration,
  5. List<TextInputFormatter> inputFormatters,
  6. TextInputType keyboardType = TextInputType.phone,
  7. TextEditingController controller,
  8. FocusNode focusNode,
  9. bool autoFocus = false,
  10. TextInputAction textInputAction = TextInputAction.done,
  11. bool enabled = true,
  12. ValueChanged<String> onChanged,
  13. dynamic textCapitalization,
  14. bool autocorrect = false,
  15. bool enableInteractiveSelection = false,
  16. ToolbarOptions toolbarOptions,
  17. Iterable<String> autofillHints,
  18. Cursor cursor}
)

Implementation

PinInputTextField({
  Key key,
  this.pinLength: _kDefaultPinLength,
  this.onSubmit,
  this.decoration = _kDefaultDecoration,
  this.inputFormatters,
  this.keyboardType: TextInputType.phone,
  this.controller,
  this.focusNode,
  this.autoFocus = false,
  this.textInputAction = TextInputAction.done,
  this.enabled = true,
  this.onChanged,
  textCapitalization,
  this.autocorrect = false,
  this.enableInteractiveSelection = false,
  this.toolbarOptions,
  this.autofillHints,
  Cursor cursor,
})  :

      /// pinLength must larger than 0.
      /// If pinEditingController isn't null, guarantee the [pinLength] equals to the pinEditingController's _pinMaxLength
      assert(pinLength != null && pinLength > 0),
      assert(decoration != null),

      /// Hint length must equal to the [pinLength].
      assert(decoration.hintText == null ||
          decoration.hintText.length == pinLength),
      assert(!(decoration is SupportGap) ||
          (decoration is SupportGap &&
                  (decoration as SupportGap).getGapWidthList == null ||
              (decoration as SupportGap).getGapWidthList.length ==
                  pinLength - 1)),
      textCapitalization = textCapitalization ?? TextCapitalization.none,
      cursor = cursor ?? Cursor.disabled(),
      super(key: key);