PrismOtpField constructor

const PrismOtpField({
  1. Key? key,
  2. int length = 6,
  3. ValueChanged<String>? onChanged,
  4. ValueChanged<String>? onCompleted,
  5. TextEditingController? controller,
  6. bool autofocus = false,
  7. bool enabled = true,
  8. bool obscure = false,
  9. double boxSize = 48,
  10. double gap = 8,
  11. String? errorText,
  12. String? helperText,
  13. Iterable<String> autofillHints = const [AutofillHints.oneTimeCode],
  14. TextInputType keyboardType = TextInputType.number,
  15. int? groupSeparatorAfter,
  16. Color? accentColor,
  17. bool hasError = false,
  18. String semanticLabel = 'Verification code',
  19. Widget boxBuilder(
    1. BuildContext context,
    2. int index,
    3. String char,
    4. bool focused,
    )?,
})

Creates an OTP field.

Implementation

const PrismOtpField({
  super.key,
  this.length = 6,
  this.onChanged,
  this.onCompleted,
  this.controller,
  this.autofocus = false,
  this.enabled = true,
  this.obscure = false,
  this.boxSize = 48,
  this.gap = 8,
  this.errorText,
  this.helperText,
  this.autofillHints = const [AutofillHints.oneTimeCode],
  this.keyboardType = TextInputType.number,
  this.groupSeparatorAfter,
  this.accentColor,
  this.hasError = false,
  this.semanticLabel = 'Verification code',
  this.boxBuilder,
});