OTPTextField constructor

const OTPTextField({
  1. Key? key,
  2. TextEditingController? controller,
  3. FocusNode? focusNode,
  4. void onCompleted(
    1. String
    )?,
  5. void onChanged(
    1. String
    )?,
  6. void onSubmitted(
    1. String
    )?,
  7. int length = 6,
  8. OTPStyle style = OTPStyle.boxed,
  9. OTPAnimationType animationType = OTPAnimationType.slide,
  10. double? pinWidth,
  11. double? pinHeight,
  12. double? spacing,
  13. double? borderRadius,
  14. double borderWidth = 1.5,
  15. Color? defaultBorderColor,
  16. Color? focusedBorderColor,
  17. Color? submittedBorderColor,
  18. Color? errorBorderColor,
  19. Color? successBorderColor,
  20. Color? fillColor,
  21. Color? focusedFillColor,
  22. Color? submittedFillColor,
  23. Color? errorFillColor,
  24. Color? successFillColor,
  25. Color? textColor,
  26. double? fontSize,
  27. FontWeight? fontWeight,
  28. String? fontFamily,
  29. TextStyle? textStyle,
  30. bool obscureText = false,
  31. String obscuringCharacter = '•',
  32. Widget? obscuringWidget,
  33. bool showCursor = true,
  34. Color? cursorColor,
  35. double cursorWidth = 2,
  36. double? cursorHeight,
  37. Widget? cursor,
  38. TextInputType keyboardType = TextInputType.number,
  39. TextInputAction textInputAction = TextInputAction.done,
  40. bool autofocus = false,
  41. bool readOnly = false,
  42. bool enabled = true,
  43. bool enableSuggestions = false,
  44. bool useNativeKeyboard = true,
  45. bool hapticFeedback = true,
  46. bool autoSubmit = false,
  47. bool closeKeyboardOnComplete = true,
  48. String? validator(
    1. String?
    )?,
  49. String? errorText,
  50. bool hasError = false,
  51. bool isSuccess = false,
  52. Duration errorAnimationDuration = const Duration(milliseconds: 300),
  53. bool showErrorAnimation = true,
  54. List<TextInputFormatter>? inputFormatters,
  55. Iterable<String>? autofillHints,
  56. bool enableIMEPersonalizedLearning = false,
  57. Widget contextMenuBuilder(
    1. BuildContext,
    2. EditableTextState
    )?,
  58. VoidCallback? onTap,
  59. VoidCallback? onLongPress,
  60. void onTapOutside(
    1. PointerDownEvent
    )?,
  61. MouseCursor? mouseCursor,
  62. bool forceErrorState = false,
  63. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
  64. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  65. AlignmentGeometry pinContentAlignment = Alignment.center,
  66. Widget separatorBuilder(
    1. int index
    )?,
  67. Widget? preFilledWidget,
  68. PinTheme? followingPinTheme,
  69. PinTheme? disabledPinTheme,
  70. PinTheme? errorPinTheme,
  71. String? semanticLabel,
  72. bool? enableSecurity,
})

Implementation

const OTPTextField({
  super.key,
  this.controller,
  this.focusNode,
  this.onCompleted,
  this.onChanged,
  this.onSubmitted,
  this.length = 6,
  this.style = OTPStyle.boxed,
  this.animationType = OTPAnimationType.slide,
  this.pinWidth,
  this.pinHeight,
  this.spacing,
  this.borderRadius,
  this.borderWidth = 1.5,
  this.defaultBorderColor,
  this.focusedBorderColor,
  this.submittedBorderColor,
  this.errorBorderColor,
  this.successBorderColor,
  this.fillColor,
  this.focusedFillColor,
  this.submittedFillColor,
  this.errorFillColor,
  this.successFillColor,
  this.textColor,
  this.fontSize,
  this.fontWeight,
  this.fontFamily,
  this.textStyle,
  this.obscureText = false,
  this.obscuringCharacter = '•',
  this.obscuringWidget,
  this.showCursor = true,
  this.cursorColor,
  this.cursorWidth = 2,
  this.cursorHeight,
  this.cursor,
  this.keyboardType = TextInputType.number,
  this.textInputAction = TextInputAction.done,
  this.autofocus = false,
  this.readOnly = false,
  this.enabled = true,
  this.enableSuggestions = false,
  this.useNativeKeyboard = true,
  this.hapticFeedback = true,
  this.autoSubmit = false,
  this.closeKeyboardOnComplete = true,
  this.validator,
  this.errorText,
  this.hasError = false,
  this.isSuccess = false,
  this.errorAnimationDuration = const Duration(milliseconds: 300),
  this.showErrorAnimation = true,
  this.inputFormatters,
  this.autofillHints,
  this.enableIMEPersonalizedLearning = false,
  this.contextMenuBuilder,
  this.onTap,
  this.onLongPress,
  this.onTapOutside,
  this.mouseCursor,
  this.forceErrorState = false,
  this.mainAxisAlignment = MainAxisAlignment.center,
  this.crossAxisAlignment = CrossAxisAlignment.center,
  this.pinContentAlignment = Alignment.center,
  this.separatorBuilder,
  this.preFilledWidget,
  this.followingPinTheme,
  this.disabledPinTheme,
  this.errorPinTheme,
  this.semanticLabel,
  this.enableSecurity,
});