PinCodeTextField constructor
PinCodeTextField({
- Key? key,
- required BuildContext appContext,
- required int length,
- TextEditingController? controller,
- bool obscureText = false,
- String obscuringCharacter = '●',
- Widget? obscuringWidget,
- bool blinkWhenObscuring = false,
- Duration blinkDuration = const Duration(milliseconds: 500),
- required ValueChanged<
String> onChanged, - ValueChanged<
String> ? onCompleted, - Color? backgroundColor,
- MainAxisAlignment mainAxisAlignment = MainAxisAlignment.spaceBetween,
- Duration animationDuration = const Duration(milliseconds: 150),
- Curve animationCurve = Curves.easeInOut,
- AnimationType animationType = AnimationType.slide,
- TextInputType keyboardType = TextInputType.visiblePassword,
- bool autoFocus = false,
- FocusNode? focusNode,
- Function? onTap,
- bool enabled = true,
- List<
TextInputFormatter> inputFormatters = const <TextInputFormatter>[], - TextStyle? textStyle,
- bool useHapticFeedback = false,
- HapticFeedbackTypes hapticFeedbackTypes = HapticFeedbackTypes.light,
- TextStyle? pastedTextStyle,
- bool enableActiveFill = false,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextInputAction textInputAction = TextInputAction.done,
- bool autoDismissKeyboard = true,
- bool autoDisposeControllers = true,
- ValueChanged<
String> ? onSubmitted, - StreamController<
ErrorAnimationType> ? errorAnimationController, - bool beforeTextPaste(
- String? text
- DialogConfig? dialogConfig,
- PinTheme pinTheme = const PinTheme.defaults(),
- Brightness? keyboardAppearance,
- FormFieldValidator<
String> ? validator, - FormFieldSetter<
String> ? onSaved, - AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction,
- double errorTextSpace = 16,
- TextDirection errorTextDirection = TextDirection.ltr,
- EdgeInsets errorTextMargin = EdgeInsets.zero,
- bool enablePinAutofill = true,
- int errorAnimationDuration = 500,
- List<
BoxShadow> ? boxShadows, - bool showCursor = true,
- Color? cursorColor,
- double cursorWidth = 2,
- double? cursorHeight,
- String? hintCharacter,
- TextStyle? hintStyle,
- Gradient? textGradient,
- bool readOnly = false,
- bool autoUnfocus = true,
- AutofillContextAction onAutoFillDisposeAction = AutofillContextAction.commit,
- bool useExternalAutoFillGroup = false,
- 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);