OtpPlusInputs constructor
const
OtpPlusInputs({
- Key? key,
- required OtpFieldShape shape,
- required int length,
- bool? enabled,
- UndoHistoryController? undoController,
- TextInputAction? textInputAction,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextDirection textDirection = TextDirection.ltr,
- TextStyle? textStyle,
- TextStyle? style,
- StrutStyle? strutStyle,
- TextAlign textAlign = TextAlign.center,
- TextAlignVertical textAlignVertical = TextAlignVertical.center,
- double size = 50,
- double horizontalSpacing = 10,
- double verticalSpacing = 10,
- EdgeInsets? contentPadding,
- Color cursorColor = Colors.black,
- double cursorWidth = 1.5,
- double? cursorHeight,
- Radius? cursorRadius,
- bool? cursorOpacityAnimates,
- bool obscureText = false,
- String obscuringCharacter = '*',
- Color? borderColor,
- Color? focusedBorderColor,
- Color? errorBorderColor,
- void onComplete(
- String code
- void onChanged(
- String code
- void onSubmit(
- String code
- bool? ignorePointers,
- String? pasteText,
- 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,
});