OTPTextField constructor

const OTPTextField({
  1. Key? key,
  2. int length = 4,
  3. double width = 10,
  4. OtpFieldController? controller,
  5. double fieldWidth = 30,
  6. double spaceBetween = 0,
  7. OtpFieldStyle? otpFieldStyle,
  8. bool hasError = false,
  9. EdgeInsetsGeometry? margin,
  10. TextInputType keyboardType = TextInputType.number,
  11. TextStyle style = const TextStyle(),
  12. double outlineBorderRadius = 10,
  13. MainAxisAlignment textFieldAlignment = MainAxisAlignment.spaceBetween,
  14. bool obscureText = false,
  15. FieldStyle fieldStyle = FieldStyle.underline,
  16. ValueChanged<String>? onChanged,
  17. List<TextInputFormatter>? inputFormatter,
  18. EdgeInsets contentPadding = const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
  19. bool isDense = false,
  20. 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);