BankAmountKeypad class
Large numeric keypad tuned for currency input.
The host app owns the current amount string and passes it in via amountText. Digit presses and delete events are surfaced via callbacks; the widget never mutates state itself.
BankAmountKeypad(
amountText: _amount,
currencyCode: 'GBP',
onDigit: (d) => setState(() => _amount += d),
onDelete: () => setState(() {
if (_amount.isNotEmpty) {
_amount = _amount.substring(0, _amount.length - 1);
}
}),
onDecimalPoint: () => setState(() {
if (!_amount.contains('.')) _amount += '.';
}),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BankAmountKeypad
Constructors
-
BankAmountKeypad({required String amountText, required String currencyCode, required ValueChanged<
String> onDigit, required VoidCallback onDelete, Key? key, VoidCallback? onDecimalPoint, NumeralStyle numeralStyle = NumeralStyle.western, double? maxAmount, bool enabled = true, BorderRadius? keyRadius, Color? keyColor, Color? keyForegroundColor, TextStyle? amountStyle, TextStyle? currencyStyle, TextStyle? keyTextStyle, IconData? deleteIcon, double? keyWidth, double? keyHeight, String deleteSemanticLabel = 'Delete', String decimalSemanticLabel = 'Decimal point', String? semanticLabel}) -
const
Properties
- amountStyle → TextStyle?
-
Merged over the amount display style (theme numeralHero in onSurface).
final
- amountText → String
-
Current formatted amount string shown in the display area.
final
- currencyCode → String
-
ISO 4217 currency code, e.g.
'GBP','USD'.final - currencyStyle → TextStyle?
-
Merged over the currency code style
(BankTokens.headlineMedium in onSurfaceVariant).
final
- decimalSemanticLabel → String
-
Semantics label of the decimal-point key. Defaults to
'Decimal point'.final - deleteIcon → IconData?
-
Overrides the delete key glyph. Defaults to
Icons.backspace_outlined.
final
- deleteSemanticLabel → String
-
Semantics label of the delete key. Defaults to
'Delete'.final - enabled → bool
-
When
false, the entire keypad is rendered at 40 % opacity and does not respond to gestures.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- keyColor → Color?
-
Overrides the background color of each key. Defaults to the theme
surfaceVariant.
final
- keyForegroundColor → Color?
-
Overrides the digit, decimal, and delete glyph color on each key.
Defaults to the theme onSurface.
final
- keyHeight → double?
-
Overrides the height of each key. Defaults to
56.final - keyRadius → BorderRadius?
-
Overrides the corner radius of each key. Defaults to the theme
buttonRadius.
final
- keyTextStyle → TextStyle?
-
Merged over each key label style
(BankTokens.headlineMedium in onSurface).
final
- keyWidth → double?
-
Overrides the width of each key. Defaults to
88.final - maxAmount → double?
-
Optional upper bound; when the current parsed amount meets or exceeds
this value, digit keys are rendered at reduced opacity. The host app
remains responsible for enforcing the limit: this is a visual cue only.
final
- numeralStyle → NumeralStyle
-
Numeral script used when displaying the amount.
final
- onDecimalPoint → VoidCallback?
-
When non-null, the decimal-point key is active and this callback is
invoked when the user taps it. When
null, the cell is rendered as an empty placeholder.final - onDelete → VoidCallback
-
Called when the user taps the delete/backspace key.
final
-
onDigit
→ ValueChanged<
String> -
Called with
'0'–'9'when the user taps a digit key.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Overrides the semantics label of the amount display. Defaults to
'<currencyCode> <amount>'.final
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