OTPTextField constructor
const
OTPTextField({
- Key? key,
- int length = 4,
- double width = 10,
- OtpFieldController? controller,
- double fieldWidth = 30,
- double spaceBetween = 0,
- OtpFieldStyle? otpFieldStyle,
- bool hasError = false,
- EdgeInsetsGeometry? margin,
- TextInputType keyboardType = TextInputType.number,
- TextStyle style = const TextStyle(),
- double outlineBorderRadius = 10,
- MainAxisAlignment textFieldAlignment = MainAxisAlignment.spaceBetween,
- bool obscureText = false,
- FieldStyle fieldStyle = FieldStyle.underline,
- ValueChanged<
String> ? onChanged, - List<
TextInputFormatter> ? inputFormatter, - EdgeInsets contentPadding = const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
- bool isDense = false,
- ValueChanged<
String> ? onCompleted,
Implementation
const OTPTextField({
Key? key,
this.length = 4,
this.width = 10,
this.controller,
this.fieldWidth = 30,
this.spaceBetween = 0,
this.otpFieldStyle,
this.hasError = false,
this.margin,
this.keyboardType = TextInputType.number,
this.style = const TextStyle(),
this.outlineBorderRadius: 10,
this.textFieldAlignment = MainAxisAlignment.spaceBetween,
this.obscureText = false,
this.fieldStyle = FieldStyle.underline,
this.onChanged,
this.inputFormatter,
this.contentPadding =
const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
this.isDense = false,
this.onCompleted,
}) : assert(length > 1),
super(key: key);