OtpPlusInputs constructor

const OtpPlusInputs({
  1. Key? key,
  2. required OtpFieldShape shape,
  3. required int length,
  4. bool? enabled,
  5. UndoHistoryController? undoController,
  6. TextInputAction? textInputAction,
  7. TextCapitalization textCapitalization = TextCapitalization.none,
  8. TextDirection textDirection = TextDirection.ltr,
  9. TextStyle? textStyle,
  10. TextStyle? style,
  11. StrutStyle? strutStyle,
  12. TextAlign textAlign = TextAlign.center,
  13. TextAlignVertical textAlignVertical = TextAlignVertical.center,
  14. double size = 50,
  15. double horizontalSpacing = 10,
  16. double verticalSpacing = 10,
  17. EdgeInsets? contentPadding,
  18. Color cursorColor = Colors.black,
  19. double cursorWidth = 1.5,
  20. double? cursorHeight,
  21. Radius? cursorRadius,
  22. bool? cursorOpacityAnimates,
  23. bool obscureText = false,
  24. String obscuringCharacter = '*',
  25. Color? borderColor,
  26. Color? focusedBorderColor,
  27. Color? errorBorderColor,
  28. void onComplete(
    1. String code
    )?,
  29. void onChanged(
    1. String code
    )?,
  30. void onSubmit(
    1. String code
    )?,
  31. bool? ignorePointers,
  32. String? pasteText,
  33. bool enableAutoFill = false,
})

Implementation

const OtpPlusInputs({
  super.key,

  // Required parameters
  required this.shape,
  required this.length,

  // Context and input behavior
  this.enabled,
  this.undoController,
  this.textInputAction,
  this.textCapitalization = TextCapitalization.none,
  this.textDirection = TextDirection.ltr,

  // Styling and layout
  this.textStyle,
  this.style,
  this.strutStyle,
  this.textAlign = TextAlign.center,
  this.textAlignVertical = TextAlignVertical.center,
  this.size = 50,
  this.horizontalSpacing = 10,
  this.verticalSpacing = 10,
  this.contentPadding,

  // Cursor customization
  this.cursorColor = Colors.black,
  this.cursorWidth = 1.5,
  this.cursorHeight,
  this.cursorRadius,
  this.cursorOpacityAnimates,

  // Obscuring text
  this.obscureText = false,
  this.obscuringCharacter = '*',

  // Border colors
  this.borderColor,
  this.focusedBorderColor,
  this.errorBorderColor,

  // Callbacks
  this.onComplete,
  this.onChanged,
  this.onSubmit,

  // Other
  this.ignorePointers,
  this.pasteText,

  //!Hint Autofill is not working correctly in web platform if user put some number in field and then try to focus on field again
  this.enableAutoFill = false,
});