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. List<int>? separatorPositions,
  17. Widget? separator = PinputConstants._defaultSeparator,
  18. String smsCodeMatcher = PinputConstants.defaultSmsCodeMatcher,
  19. String? senderPhoneNumber,
  20. AndroidSmsAutofillMethod androidSmsAutofillMethod = AndroidSmsAutofillMethod.none,
  21. bool listenForMultipleSmsOnAndroid = false,
  22. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
  23. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.start,
  24. AlignmentGeometry pinContentAlignment = Alignment.center,
  25. Curve animationCurve = Curves.easeIn,
  26. Duration animationDuration = PinputConstants._animationDuration,
  27. PinAnimationType pinAnimationType = PinAnimationType.scale,
  28. bool enabled = true,
  29. bool readOnly = false,
  30. bool useNativeKeyboard = true,
  31. bool toolbarEnabled = true,
  32. bool autofocus = false,
  33. bool obscureText = false,
  34. bool showCursor = true,
  35. bool isCursorAnimationEnabled = true,
  36. bool enableIMEPersonalizedLearning = false,
  37. bool enableSuggestions = true,
  38. HapticFeedbackType hapticFeedbackType = HapticFeedbackType.disabled,
  39. bool closeKeyboardWhenCompleted = true,
  40. TextInputType keyboardType = TextInputType.number,
  41. TextCapitalization textCapitalization = TextCapitalization.none,
  42. Offset? slideTransitionBeginOffset,
  43. Widget? cursor,
  44. Brightness? keyboardAppearance,
  45. List<TextInputFormatter> inputFormatters = const [],
  46. TextInputAction? textInputAction,
  47. Iterable<String>? autofillHints,
  48. String obscuringCharacter = '•',
  49. Widget? obscuringWidget,
  50. TextSelectionControls? selectionControls,
  51. String? restorationId,
  52. ValueChanged<String>? onClipboardFound,
  53. AppPrivateCommandCallback? onAppPrivateCommand,
  54. MouseCursor? mouseCursor,
  55. bool forceErrorState = false,
  56. String? errorText,
  57. FormFieldValidator<String>? validator,
  58. PinputErrorBuilder? errorBuilder,
  59. TextStyle? errorTextStyle,
  60. PinputAutovalidateMode pinputAutovalidateMode = PinputAutovalidateMode.onSubmit,
  61. EdgeInsets scrollPadding = const EdgeInsets.all(20),
  62. EditableTextContextMenuBuilder? contextMenuBuilder = _defaultContextMenuBuilder,
  63. TapRegionCallback? onTapOutside,
  64. Key? key,
})

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.separatorPositions,
  this.separator = PinputConstants._defaultSeparator,
  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);