PinCodeTextField constructor

PinCodeTextField({
  1. Key? key,
  2. required BuildContext appContext,
  3. required int length,
  4. TextEditingController? controller,
  5. bool obscureText = false,
  6. String obscuringCharacter = '●',
  7. Widget? obscuringWidget,
  8. bool blinkWhenObscuring = false,
  9. Duration blinkDuration = const Duration(milliseconds: 500),
  10. required ValueChanged<String> onChanged,
  11. ValueChanged<String>? onCompleted,
  12. Color? backgroundColor,
  13. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.spaceBetween,
  14. Duration animationDuration = const Duration(milliseconds: 150),
  15. Curve animationCurve = Curves.easeInOut,
  16. AnimationType animationType = AnimationType.slide,
  17. TextInputType keyboardType = TextInputType.visiblePassword,
  18. bool autoFocus = false,
  19. FocusNode? focusNode,
  20. Function? onTap,
  21. bool enabled = true,
  22. List<TextInputFormatter> inputFormatters = const <TextInputFormatter>[],
  23. TextStyle? textStyle,
  24. bool useHapticFeedback = false,
  25. HapticFeedbackTypes hapticFeedbackTypes = HapticFeedbackTypes.light,
  26. TextStyle? pastedTextStyle,
  27. bool enableActiveFill = false,
  28. TextCapitalization textCapitalization = TextCapitalization.none,
  29. TextInputAction textInputAction = TextInputAction.done,
  30. bool autoDismissKeyboard = true,
  31. bool autoDisposeControllers = true,
  32. ValueChanged<String>? onSubmitted,
  33. StreamController<ErrorAnimationType>? errorAnimationController,
  34. bool beforeTextPaste(
    1. String? text
    )?,
  35. DialogConfig? dialogConfig,
  36. PinTheme pinTheme = const PinTheme.defaults(),
  37. Brightness? keyboardAppearance,
  38. FormFieldValidator<String>? validator,
  39. FormFieldSetter<String>? onSaved,
  40. AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction,
  41. double errorTextSpace = 16,
  42. TextDirection errorTextDirection = TextDirection.ltr,
  43. EdgeInsets errorTextMargin = EdgeInsets.zero,
  44. bool enablePinAutofill = true,
  45. int errorAnimationDuration = 500,
  46. List<BoxShadow>? boxShadows,
  47. bool showCursor = true,
  48. Color? cursorColor,
  49. double cursorWidth = 2,
  50. double? cursorHeight,
  51. String? hintCharacter,
  52. TextStyle? hintStyle,
  53. Gradient? textGradient,
  54. bool readOnly = false,
  55. bool autoUnfocus = true,
  56. AutofillContextAction onAutoFillDisposeAction = AutofillContextAction.commit,
  57. bool useExternalAutoFillGroup = false,
  58. EdgeInsets scrollPadding = const EdgeInsets.all(20),
})

Implementation

PinCodeTextField({
  Key? key,
  required this.appContext,
  required this.length,
  this.controller,
  this.obscureText = false,
  this.obscuringCharacter = '●',
  this.obscuringWidget,
  this.blinkWhenObscuring = false,
  this.blinkDuration = const Duration(milliseconds: 500),
  required this.onChanged,
  this.onCompleted,
  this.backgroundColor,
  this.mainAxisAlignment = MainAxisAlignment.spaceBetween,
  this.animationDuration = const Duration(milliseconds: 150),
  this.animationCurve = Curves.easeInOut,
  this.animationType = AnimationType.slide,
  this.keyboardType = TextInputType.visiblePassword,
  this.autoFocus = false,
  this.focusNode,
  this.onTap,
  this.enabled = true,
  this.inputFormatters = const <TextInputFormatter>[],
  this.textStyle,
  this.useHapticFeedback = false,
  this.hapticFeedbackTypes = HapticFeedbackTypes.light,
  this.pastedTextStyle,
  this.enableActiveFill = false,
  this.textCapitalization = TextCapitalization.none,
  this.textInputAction = TextInputAction.done,
  this.autoDismissKeyboard = true,
  this.autoDisposeControllers = true,
  this.onSubmitted,
  this.errorAnimationController,
  this.beforeTextPaste,
  this.dialogConfig,
  this.pinTheme = const PinTheme.defaults(),
  this.keyboardAppearance,
  this.validator,
  this.onSaved,
  this.autovalidateMode = AutovalidateMode.onUserInteraction,
  this.errorTextSpace = 16,
  this.errorTextDirection = TextDirection.ltr,
  this.errorTextMargin = EdgeInsets.zero,
  this.enablePinAutofill = true,
  this.errorAnimationDuration = 500,
  this.boxShadows,
  this.showCursor = true,
  this.cursorColor,
  this.cursorWidth = 2,
  this.cursorHeight,
  this.hintCharacter,
  this.hintStyle,
  this.textGradient,
  this.readOnly = false,
  this.autoUnfocus = true,

  /// Default for [AutofillGroup]
  this.onAutoFillDisposeAction = AutofillContextAction.commit,

  /// Default create internal [AutofillGroup]
  this.useExternalAutoFillGroup = false,
  this.scrollPadding = const EdgeInsets.all(20),
})  : assert(obscuringCharacter.isNotEmpty),
      super(key: key);