PinInputTextField constructor
PinInputTextField({
- Key? key,
- int pinLength = _kDefaultPinLength,
- ValueChanged<
String> ? onSubmit, - required PinDecoration decoration,
- List<
TextInputFormatter> ? inputFormatters, - TextInputType keyboardType = TextInputType.phone,
- TextEditingController? controller,
- FocusNode? focusNode,
- bool autoFocus = false,
- TextInputAction textInputAction = TextInputAction.done,
- bool enabled = true,
- ValueChanged<
String> ? onChanged, - dynamic textCapitalization,
- bool autocorrect = false,
- bool enableInteractiveSelection = false,
- ToolbarOptions? toolbarOptions,
- EditableTextContextMenuBuilder? contextMenuBuilder,
- Iterable<
String> ? autofillHints, - Cursor? cursor,
- 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);