PinInputTextField constructor

PinInputTextField({
  1. Key? key,
  2. int pinLength = _kDefaultPinLength,
  3. ValueChanged<String>? onSubmit,
  4. required PinDecoration decoration,
  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. EditableTextContextMenuBuilder? contextMenuBuilder,
  18. Iterable<String>? autofillHints,
  19. Cursor? cursor,
  20. TapRegionCallback? tapRegionCallback,
})

Implementation

PinInputTextField({
  Key? key,
  this.pinLength = _kDefaultPinLength,
  this.onSubmit,
  required this.decoration,
  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.contextMenuBuilder,
  this.autofillHints,
  Cursor? cursor,
  this.tapRegionCallback,
})  :

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

      /// 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);