utils/security/otp_security library

Classes

OTPAttemptTracker
Rate limiter for OTP verification attempts.
OTPSecurityConfig
Security configuration for OTP/PIN input fields.

Functions

safeOTPCallback(void callback(String)?, String value, {String context = 'OTP callback'}) → void
Safely executes an OTP callback with error handling.
safeOTPVoidCallback(VoidCallback? callback, {String context = 'OTP void callback'}) → void
Safely executes a void callback with error handling.
validateOTPBorderRadius(double? radius, {required double defaultValue, bool? enableSecurity}) double
Validates border radius within configured bounds.
validateOTPBorderWidth(double? width, {double defaultValue = 1.5, bool? enableSecurity}) double
Validates border width within configured bounds.
validateOTPFontSize(double? fontSize, {required double defaultValue, bool? enableSecurity}) double
Validates font size within configured bounds.
validateOTPLength(int? length, {int defaultValue = 6, bool? enableSecurity}) int
Validates OTP length within configured bounds. Returns the validated length.
validateOTPSpacing(double? spacing, {required double defaultValue, bool? enableSecurity}) double
Validates spacing between pins.
validatePinSize(double? size, {required double defaultValue, bool? enableSecurity}) double
Validates pin box size within configured bounds.