OtpTextField constructor
OtpTextField({
- bool showCursor = true,
- int numberOfFields = 4,
- double fieldWidth = 40.0,
- double? fieldHeight,
- Alignment? alignment,
- EdgeInsetsGeometry margin = const EdgeInsets.only(right: 8.0),
- TextStyle? textStyle,
- bool clearText = false,
- List<
TextStyle?> styles = const [], - TextInputType keyboardType = TextInputType.number,
- double borderWidth = 2.0,
- Color? cursorColor,
- Color disabledBorderColor = const Color(0xFFE7E7E7),
- Color enabledBorderColor = const Color(0xFFE7E7E7),
- Color borderColor = const Color(0xFFE7E7E7),
- Color focusedBorderColor = const Color(0xFF4F44FF),
- MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
- CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
- HandleControllers? handleControllers,
- OnCodeEnteredCompletion? onSubmit,
- bool obscureText = false,
- bool showFieldAsBox = false,
- bool enabled = true,
- bool autoFocus = false,
- bool hasCustomInputDecoration = false,
- bool filled = false,
- Color fillColor = const Color(0xFFFFFFFF),
- bool readOnly = false,
- InputDecoration? decoration,
- OnCodeEnteredCompletion? onCodeChanged,
- BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4.0)),
- List<
TextInputFormatter> ? inputFormatters, - EdgeInsetsGeometry? contentPadding,
Implementation
OtpTextField({
this.showCursor = true,
this.numberOfFields = 4,
this.fieldWidth = 40.0,
this.fieldHeight,
this.alignment,
this.margin = const EdgeInsets.only(right: 8.0),
this.textStyle,
this.clearText = false,
this.styles = const [],
this.keyboardType = TextInputType.number,
this.borderWidth = 2.0,
this.cursorColor,
this.disabledBorderColor = const Color(0xFFE7E7E7),
this.enabledBorderColor = const Color(0xFFE7E7E7),
this.borderColor = const Color(0xFFE7E7E7),
this.focusedBorderColor = const Color(0xFF4F44FF),
this.mainAxisAlignment = MainAxisAlignment.center,
this.crossAxisAlignment = CrossAxisAlignment.center,
this.handleControllers,
this.onSubmit,
this.obscureText = false,
this.showFieldAsBox = false,
this.enabled = true,
this.autoFocus = false,
this.hasCustomInputDecoration = false,
this.filled = false,
this.fillColor = const Color(0xFFFFFFFF),
this.readOnly = false,
this.decoration,
this.onCodeChanged,
this.borderRadius = const BorderRadius.all(Radius.circular(4.0)),
this.inputFormatters,
this.contentPadding,
}) : assert(numberOfFields > 0),
assert(styles.length > 0
? styles.length == numberOfFields
: styles.length == 0);