Pinput constructor

const Pinput({
  1. int length = PinputConstants._defaultLength,
  2. PinTheme? defaultPinTheme,
  3. PinTheme? focusedPinTheme,
  4. PinTheme? submittedPinTheme,
  5. PinTheme? followingPinTheme,
  6. PinTheme? disabledPinTheme,
  7. PinTheme? errorPinTheme,
  8. ValueChanged<String>? onChanged,
  9. ValueChanged<String>? onCompleted,
  10. ValueChanged<String>? onSubmitted,
  11. VoidCallback? onTap,
  12. VoidCallback? onLongPress,
  13. TextEditingController? controller,
  14. FocusNode? focusNode,
  15. Widget? preFilledWidget,
  16. JustIndexedWidgetBuilder? separatorBuilder,
  17. String smsCodeMatcher = PinputConstants.defaultSmsCodeMatcher,
  18. String? senderPhoneNumber,
  19. AndroidSmsAutofillMethod androidSmsAutofillMethod = AndroidSmsAutofillMethod.none,
  20. bool listenForMultipleSmsOnAndroid = false,
  21. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
  22. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start,
  23. AlignmentGeometry pinContentAlignment = Alignment.center,
  24. Curve animationCurve = Curves.easeIn,
  25. Duration animationDuration = PinputConstants._animationDuration,
  26. PinAnimationType pinAnimationType = PinAnimationType.scale,
  27. bool enabled = true,
  28. bool readOnly = false,
  29. bool useNativeKeyboard = true,
  30. bool toolbarEnabled = true,
  31. bool autofocus = false,
  32. bool obscureText = false,
  33. bool showCursor = true,
  34. bool isCursorAnimationEnabled = true,
  35. bool enableIMEPersonalizedLearning = false,
  36. bool enableSuggestions = true,
  37. HapticFeedbackType hapticFeedbackType = HapticFeedbackType.disabled,
  38. bool closeKeyboardWhenCompleted = true,
  39. TextInputType keyboardType = TextInputType.number,
  40. TextCapitalization textCapitalization = TextCapitalization.none,
  41. Offset? slideTransitionBeginOffset,
  42. Widget? cursor,
  43. Brightness? keyboardAppearance,
  44. List<TextInputFormatter> inputFormatters = const [],
  45. TextInputAction? textInputAction,
  46. Iterable<String>? autofillHints,
  47. String obscuringCharacter = '•',
  48. Widget? obscuringWidget,
  49. TextSelectionControls? selectionControls,
  50. String? restorationId,
  51. ValueChanged<String>? onClipboardFound,
  52. AppPrivateCommandCallback? onAppPrivateCommand,
  53. MouseCursor? mouseCursor,
  54. bool forceErrorState = false,
  55. String? errorText,
  56. FormFieldValidator<String>? validator,
  57. PinputErrorBuilder? errorBuilder,
  58. TextStyle? errorTextStyle,
  59. PinputAutovalidateMode pinputAutovalidateMode = PinputAutovalidateMode.onSubmit,
  60. EdgeInsets scrollPadding = const EdgeInsets.all(20),
  61. EditableTextContextMenuBuilder? contextMenuBuilder = _defaultContextMenuBuilder,
  62. TapRegionCallback? onTapOutside,
  63. Key? key,
})

Creates a PinPut widget

Implementation

const Pinput({
  this.length = PinputConstants._defaultLength,
  this.defaultPinTheme,
  this.focusedPinTheme,
  this.submittedPinTheme,
  this.followingPinTheme,
  this.disabledPinTheme,
  this.errorPinTheme,
  this.onChanged,
  this.onCompleted,
  this.onSubmitted,
  this.onTap,
  this.onLongPress,
  this.controller,
  this.focusNode,
  this.preFilledWidget,
  this.separatorBuilder,
  this.smsCodeMatcher = PinputConstants.defaultSmsCodeMatcher,
  this.senderPhoneNumber,
  this.androidSmsAutofillMethod = AndroidSmsAutofillMethod.none,
  this.listenForMultipleSmsOnAndroid = false,
  this.mainAxisAlignment = MainAxisAlignment.center,
  this.crossAxisAlignment = CrossAxisAlignment.start,
  this.pinContentAlignment = Alignment.center,
  this.animationCurve = Curves.easeIn,
  this.animationDuration = PinputConstants._animationDuration,
  this.pinAnimationType = PinAnimationType.scale,
  this.enabled = true,
  this.readOnly = false,
  this.useNativeKeyboard = true,
  this.toolbarEnabled = true,
  this.autofocus = false,
  this.obscureText = false,
  this.showCursor = true,
  this.isCursorAnimationEnabled = true,
  this.enableIMEPersonalizedLearning = false,
  this.enableSuggestions = true,
  this.hapticFeedbackType = HapticFeedbackType.disabled,
  this.closeKeyboardWhenCompleted = true,
  this.keyboardType = TextInputType.number,
  this.textCapitalization = TextCapitalization.none,
  this.slideTransitionBeginOffset,
  this.cursor,
  this.keyboardAppearance,
  this.inputFormatters = const [],
  this.textInputAction,
  this.autofillHints,
  this.obscuringCharacter = '•',
  this.obscuringWidget,
  this.selectionControls,
  this.restorationId,
  this.onClipboardFound,
  this.onAppPrivateCommand,
  this.mouseCursor,
  this.forceErrorState = false,
  this.errorText,
  this.validator,
  this.errorBuilder,
  this.errorTextStyle,
  this.pinputAutovalidateMode = PinputAutovalidateMode.onSubmit,
  this.scrollPadding = const EdgeInsets.all(20),
  this.contextMenuBuilder = _defaultContextMenuBuilder,
  this.onTapOutside,
  Key? key,
})  : assert(obscuringCharacter.length == 1),
      assert(length > 0),
      assert(
        textInputAction != TextInputAction.newline,
        'Pinput is not multiline',
      ),
      super(key: key);