PinPlusKeyBoardPackage constructor

const PinPlusKeyBoardPackage({
  1. Key? key,
  2. KeyboardButtonShape keyboardButtonShape = KeyboardButtonShape.defaultShape,
  3. InputShape inputShape = InputShape.defaultShape,
  4. double keyboardMaxWidth = 80,
  5. double keyboardVerticalSpacing = 8,
  6. required double spacing,
  7. Color? buttonFillColor,
  8. Color? buttonBorderColor,
  9. Color? btnTextColor,
  10. bool btnHasBorder = true,
  11. double? btnBorderThickness,
  12. double? btnElevation,
  13. Color? btnShadowColor,
  14. double? inputWidth,
  15. bool isInputHidden = false,
  16. Color inputHiddenColor = Colors.black,
  17. double inputsMaxWidth = 70,
  18. required PinInputController pinInputController,
  19. required VoidCallback onSubmit,
  20. Color? inputFillColor,
  21. Color? inputBorderColor,
  22. Color? inputTextColor,
  23. bool inputHasBorder = true,
  24. double? inputBorderThickness,
  25. double? inputElevation,
  26. Color? inputShadowColor,
  27. Color errorColor = Colors.red,
  28. double? keyboardFontSize,
  29. BorderRadius? inputBorderRadius,
  30. double? inputHeight,
  31. Color? cancelColor,
  32. String? extraInput,
  33. Icon? backButton,
  34. Icon? doneButton,
  35. InputType inputType = InputType.box,
  36. BorderRadius? keyoardBtnBorderRadius,
  37. TextStyle? inputTextStyle,
  38. Widget? leftExtraInputWidget,
  39. double? keyboardBtnSize,
  40. Color? focusColor,
  41. String? keyboardFontFamily,
  42. bool enableHapticFeedback = false,
  43. String validator(
    1. String pin
    )?,
  44. void onDigitEntered(
    1. String digit,
    2. int position
    )?,
  45. String? semanticLabel,
  46. bool enableKeyboardNavigation = true,
  47. bool enableAnimations = true,
  48. Curve animationCurve = Curves.easeInOut,
  49. Duration animationDuration = const Duration(milliseconds: 200),
  50. bool enableShakeAnimation = true,
  51. bool enableSuccessAnimation = true,
  52. bool showLoadingState = false,
  53. bool useMaterial3 = true,
  54. ColorScheme? colorScheme,
  55. bool usePlatformSpecificStyling = true,
  56. bool enableBiometric = false,
  57. BiometricService? biometricService,
  58. VoidCallback? onBiometricSuccess,
  59. VoidCallback? onBiometricFailure,
  60. String? biometricReason,
  61. SecurityService? securityService,
  62. Duration? autoClearTimeout,
  63. bool enableScreenshotBlocking = false,
  64. int maxFailedAttempts = 5,
  65. Duration rateLimitWindow = const Duration(minutes: 15),
  66. Gradient? buttonGradient,
  67. Gradient? inputGradient,
  68. Widget inputFieldBuilder(
    1. BuildContext context,
    2. int position,
    3. bool hasCharacter,
    4. String? character,
    )?,
  69. Widget keyboardButtonBuilder(
    1. BuildContext context,
    2. String number
    )?,
  70. bool enableRandomKeyboard = false,
  71. bool reshuffleOnClear = false,
  72. 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,
});