OTPVerificationWidget constructor

const OTPVerificationWidget({
  1. Key? key,
  2. required Future<bool> onVerify(
    1. String otp
    ),
  3. Future<void> onResend()?,
  4. int length = 6,
  5. OTPStyle style = OTPStyle.boxed,
  6. Duration resendDuration = const Duration(seconds: 60),
  7. String? title,
  8. String? subtitle,
  9. String resendText = 'Resend code',
  10. String resendingText = 'Sending...',
  11. TextStyle? titleStyle,
  12. TextStyle? subtitleStyle,
  13. TextStyle? resendTextStyle,
  14. TextStyle? timerTextStyle,
  15. TextEditingController? otpController,
  16. bool autoFocus = true,
  17. bool closeKeyboardOnVerify = true,
  18. bool showResendButton = true,
  19. double spacing = 16.0,
  20. double? pinWidth,
  21. double? pinHeight,
  22. String? errorText,
  23. String? successText,
  24. bool isLoading = false,
  25. Widget? loadingWidget,
  26. bool enabled = true,
})

Implementation

const OTPVerificationWidget({
  super.key,
  required this.onVerify,
  this.onResend,
  this.length = 6,
  this.style = OTPStyle.boxed,
  this.resendDuration = const Duration(seconds: 60),
  this.title,
  this.subtitle,
  this.resendText = 'Resend code',
  this.resendingText = 'Sending...',
  this.titleStyle,
  this.subtitleStyle,
  this.resendTextStyle,
  this.timerTextStyle,
  this.otpController,
  this.autoFocus = true,
  this.closeKeyboardOnVerify = true,
  this.showResendButton = true,
  this.spacing = 16.0,
  this.pinWidth,
  this.pinHeight,
  this.errorText,
  this.successText,
  this.isLoading = false,
  this.loadingWidget,
  this.enabled = true,
});