OtpTextField constructor

OtpTextField({
  1. bool showCursor = true,
  2. int numberOfFields = 4,
  3. double fieldWidth = 40.0,
  4. double? fieldHeight,
  5. Alignment? alignment,
  6. EdgeInsetsGeometry margin = const EdgeInsets.only(right: 8.0),
  7. TextStyle? textStyle,
  8. bool clearText = false,
  9. List<TextStyle?> styles = const [],
  10. TextInputType keyboardType = TextInputType.number,
  11. double borderWidth = 2.0,
  12. Color? cursorColor,
  13. Color disabledBorderColor = const Color(0xFFE7E7E7),
  14. Color enabledBorderColor = const Color(0xFFE7E7E7),
  15. Color borderColor = const Color(0xFFE7E7E7),
  16. Color focusedBorderColor = const Color(0xFF4F44FF),
  17. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
  18. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  19. HandleControllers? handleControllers,
  20. OnCodeEnteredCompletion? onSubmit,
  21. bool obscureText = false,
  22. bool showFieldAsBox = false,
  23. bool enabled = true,
  24. bool autoFocus = false,
  25. bool hasCustomInputDecoration = false,
  26. bool filled = false,
  27. Color fillColor = const Color(0xFFFFFFFF),
  28. bool readOnly = false,
  29. InputDecoration? decoration,
  30. OnCodeEnteredCompletion? onCodeChanged,
  31. BorderRadius borderRadius = const BorderRadius.all(Radius.circular(4.0)),
  32. List<TextInputFormatter>? inputFormatters,
  33. 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);