BankPinKeypad class

Numeric keypad for PIN entry.

Exposes onDigit and onDelete callbacks so the host app fully owns the PIN string state. The layout mirrors a standard telephone keypad:

 1  2  3
 4  5  6
 7  8  9
[B] 0 [⌫]

Where [B] is either a biometric trigger button (when onBiometric is non-null) or an invisible placeholder.

Provide digitBuilder to replace the default digit cell rendering while keeping the standard delete and biometric cells.

BankPinKeypad(
  onDigit: (d) => setState(() => _pin += d),
  onDelete: () => setState(() {
    if (_pin.isNotEmpty) _pin = _pin.substring(0, _pin.length - 1);
  }),
  onBiometric: _handleBiometric,
)
Inheritance

Constructors

BankPinKeypad({required ValueChanged<String> onDigit, required VoidCallback onDelete, Key? key, VoidCallback? onBiometric, bool enabled = true, Widget digitBuilder(BuildContext context, String digit)?, EdgeInsetsGeometry? padding, Color? backgroundColor, Color? foregroundColor, Color? accentColor, TextStyle? digitStyle, double? keySize, IconData? deleteIcon, IconData? biometricIcon, String? biometricSemanticLabel, String? deleteSemanticLabel})
const

Properties

accentColor Color?
Accent color used for the key press splash and highlight. Defaults to the theme primary when null.
final
backgroundColor Color?
Fill color of each round digit key. Defaults to the theme surfaceVariant when null.
final
biometricIcon IconData?
Glyph for the biometric key. Defaults to BankIcons.biometric when null.
final
biometricSemanticLabel String?
Accessibility label for the biometric key. Defaults to 'Use biometrics' when null.
final
deleteIcon IconData?
Glyph for the delete (backspace) key. Defaults to Icons.backspace_outlined when null.
final
deleteSemanticLabel String?
Accessibility label for the delete key. Defaults to 'Delete' when null.
final
digitBuilder Widget Function(BuildContext context, String digit)?
Optional builder for digit cells. When provided, it replaces the default Text-based rendering for digits '1''9' and '0'. The delete and biometric cells are not affected.
final
digitStyle TextStyle?
Text style merged over the computed digit style (headline large in the resolved foreground color). Null applies no override.
final
enabled bool
When false, all keys are rendered at 40 % opacity and do not respond to gestures.
final
foregroundColor Color?
Color of the digit glyphs and the action (delete / biometric) icons. Defaults to the theme onSurface when null.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keySize double?
Diameter, in logical pixels, of every key and the empty placeholder. Defaults to 64 when null.
final
onBiometric VoidCallback?
When non-null, a fingerprint icon button is shown in the bottom-left position and this callback is invoked on tap.
final
onDelete VoidCallback
Called when the user taps the delete (backspace) key.
final
onDigit ValueChanged<String>
Called when the user taps a digit key. Receives the digit as a string ('0''9').
final
padding EdgeInsetsGeometry?
Outer padding wrapped around the whole keypad. When null, no outer padding is added (the current behavior).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited