PinPlusKeyBoardPackage constructor
const
PinPlusKeyBoardPackage({
- Key? key,
- KeyboardButtonShape keyboardButtonShape = KeyboardButtonShape.defaultShape,
- InputShape inputShape = InputShape.defaultShape,
- double keyboardMaxWidth = 80,
- double keyboardVerticalSpacing = 8,
- required double spacing,
- Color? buttonFillColor,
- Color? buttonBorderColor,
- Color? btnTextColor,
- bool btnHasBorder = true,
- double? btnBorderThickness,
- double? btnElevation,
- Color? btnShadowColor,
- double? inputWidth,
- bool isInputHidden = false,
- Color inputHiddenColor = Colors.black,
- double inputsMaxWidth = 70,
- required PinInputController pinInputController,
- required VoidCallback onSubmit,
- Color? inputFillColor,
- Color? inputBorderColor,
- Color? inputTextColor,
- bool inputHasBorder = true,
- double? inputBorderThickness,
- double? inputElevation,
- Color? inputShadowColor,
- Color errorColor = Colors.red,
- double? keyboardFontSize,
- BorderRadius? inputBorderRadius,
- double? inputHeight,
- Color? cancelColor,
- String? extraInput,
- Icon? backButton,
- Icon? doneButton,
- InputType inputType = InputType.box,
- BorderRadius? keyoardBtnBorderRadius,
- TextStyle? inputTextStyle,
- Widget? leftExtraInputWidget,
- double? keyboardBtnSize,
- Color? focusColor,
- String? keyboardFontFamily,
- bool enableHapticFeedback = false,
- String validator(
- String pin
- void onDigitEntered()?,
- String? semanticLabel,
- bool enableAnimations = true,
- Curve animationCurve = Curves.easeInOut,
- Duration animationDuration = const Duration(milliseconds: 200),
- bool enableShakeAnimation = true,
- bool enableSuccessAnimation = true,
- bool showLoadingState = false,
- bool useMaterial3 = true,
- ColorScheme? colorScheme,
- bool usePlatformSpecificStyling = true,
- bool enableBiometric = false,
- BiometricService? biometricService,
- VoidCallback? onBiometricSuccess,
- VoidCallback? onBiometricFailure,
- String? biometricReason,
- SecurityService? securityService,
- Duration? autoClearTimeout,
- bool enableScreenshotBlocking = false,
- int maxFailedAttempts = 5,
- Duration rateLimitWindow = const Duration(minutes: 15),
- Gradient? buttonGradient,
- Gradient? inputGradient,
- Widget inputFieldBuilder(
- BuildContext context,
- int position,
- bool hasCharacter,
- String? character,
- Widget keyboardButtonBuilder(
- BuildContext context,
- String number
- bool enableRandomKeyboard = false,
- bool reshuffleOnClear = false,
- bool reshuffleOnResume = false,
Creates a PinPlusKeyBoardPackage widget.
pinInputController and onSubmit are required.
spacing is also required to ensure proper layout.
All other parameters are optional and have sensible defaults.
Implementation
const PinPlusKeyBoardPackage({
super.key,
this.keyboardButtonShape = KeyboardButtonShape.defaultShape,
this.inputShape = InputShape.defaultShape,
this.keyboardMaxWidth = 80,
this.keyboardVerticalSpacing = 8,
required this.spacing,
this.buttonFillColor,
this.buttonBorderColor,
this.btnTextColor,
this.btnHasBorder = true,
this.btnBorderThickness,
this.btnElevation,
this.btnShadowColor,
this.inputWidth,
this.isInputHidden = false,
this.inputHiddenColor = Colors.black,
this.inputsMaxWidth = 70,
required this.pinInputController,
required this.onSubmit,
this.inputFillColor,
this.inputBorderColor,
this.inputTextColor,
this.inputHasBorder = true,
this.inputBorderThickness,
this.inputElevation,
this.inputShadowColor,
this.errorColor = Colors.red,
this.keyboardFontSize,
this.inputBorderRadius,
this.inputHeight,
this.cancelColor,
this.extraInput,
this.backButton,
this.doneButton,
this.inputType = InputType.box,
this.keyoardBtnBorderRadius,
this.inputTextStyle,
this.leftExtraInputWidget,
this.keyboardBtnSize,
this.focusColor,
this.keyboardFontFamily,
this.enableHapticFeedback = false,
this.validator,
this.onDigitEntered,
// New features with defaults
this.semanticLabel,
this.enableKeyboardNavigation = true,
this.enableAnimations = true,
this.animationCurve = Curves.easeInOut,
this.animationDuration = const Duration(milliseconds: 200),
this.enableShakeAnimation = true,
this.enableSuccessAnimation = true,
this.showLoadingState = false,
this.useMaterial3 = true,
this.colorScheme,
this.usePlatformSpecificStyling = true,
this.enableBiometric = false,
this.biometricService,
this.onBiometricSuccess,
this.onBiometricFailure,
this.biometricReason,
this.securityService,
this.autoClearTimeout,
this.enableScreenshotBlocking = false,
this.maxFailedAttempts = 5,
this.rateLimitWindow = const Duration(minutes: 15),
this.buttonGradient,
this.inputGradient,
this.inputFieldBuilder,
this.keyboardButtonBuilder,
this.enableRandomKeyboard = false,
this.reshuffleOnClear = false,
this.reshuffleOnResume = false,
});