CurrencyInput class

A currency input field component for the Alter Design System built on NumericInput.

Features:

  • Pre-configured Euro left icon (Icons.euro_rounded) by default.
  • Live comma formatting for International (1,000,000.00) and Indian (10,00,000.00) formats.
  • Decimal support (default 2 decimal places).
  • Min/max currency bounds validation.
Inheritance

Constructors

CurrencyInput({Key? key, String? label = 'Amount', bool isRequired = false, int? characterLimit, InputControlType type = InputControlType.gray, NumberGroupingSystem groupingSystem = NumberGroupingSystem.international, bool allowDecimals = true, int? decimalPlaces = 2, num? minValue, num? maxValue, IconData? leftIcon = Icons.euro_rounded, Widget? leftIconWidget, String? prefix, Widget? prefixWidget, String placeholder = '0.00', num? initialValue, TextEditingController? controller, FocusNode? focusNode, String? suffix, Widget? suffixWidget, ButtonIconGhost? rightButton, bool isError = false, bool showErrorMessage = true, String errorMessage = 'Error Message', List<String>? errorMessages, Widget? errorIconWidget, bool enabled = true, bool readOnly = false, bool autofocus = false, ValueChanged<num?>? onAmountChanged, ValueChanged<String>? onChanged, ValueChanged<String>? onSubmitted, VoidCallback? onTap})
Creates a CurrencyInput instance.
const

Properties

allowDecimals → bool
Whether decimal fractions are permitted.
final
autofocus → bool
Whether the input field autofocuses.
final
characterLimit → int?
Maximum allowed character limit counter displayed on typing.
final
controller → TextEditingController?
External text editing controller.
final
decimalPlaces → int?
Fixed or max number of allowed decimal digits.
final
enabled → bool
Whether the currency input is interactive.
final
errorIconWidget → Widget?
Custom icon widget override for the error message banner.
final
errorMessage → String
Default error message text.
final
errorMessages → List<String>?
Optional list of multiple error messages.
final
focusNode → FocusNode?
Focus node controlling input focus.
final
groupingSystem → NumberGroupingSystem
Digit separator format (International vs Indian numbering system).
final
hashCode → int
The hash code for this object.
no setterinherited
initialValue → num?
Initial numeric amount.
final
isError → bool
Whether the input is in an explicit error state.
final
isRequired → bool
Whether to display a red required asterisk next to the label.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label → String?
Label text displayed above the currency input.
final
leftIcon → IconData?
Leading currency icon (defaults to Icons.euro_rounded).
final
leftIconWidget → Widget?
Custom leading widget override.
final
maxValue → num?
Maximum allowed numeric amount value.
final
minValue → num?
Minimum allowed numeric amount value.
final
onAmountChanged → ValueChanged<num?>?
Callback returning parsed numeric amount on change.
final
onChanged → ValueChanged<String>?
Callback returning raw string value on change.
final
onSubmitted → ValueChanged<String>?
Callback executed on keyboard submit.
final
onTap → VoidCallback?
Callback executed when the input container is tapped.
final
placeholder → String
Hint placeholder text.
final
prefix → String?
Currency prefix text string.
final
prefixWidget → Widget?
Custom prefix widget override.
final
readOnly → bool
Whether the field is read-only.
final
rightButton → ButtonIconGhost?
Trailing action button (e.g. ButtonIconGhost).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showErrorMessage → bool
Whether to render the error message beneath the field.
final
suffix → String?
Suffix descriptor text displayed at the trailing end.
final
suffixWidget → Widget?
Custom suffix widget override.
final
type → InputControlType
Surface background and border style variant.
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

Constants

version → const String
Component version for reference. v2.2.0: Removed stepper controls in favor of standard rightButton (ButtonIconGhost) slot matching InputControl Figma spec. v2.1.0: Aligned with InputControl v2.1.0 & NumericInput v2.1.0 (removed showLabel/showCharacterLimit; labelBar renders when label is provided). v2.0.0: Aligned with InputControl v2.0.0 & NumericInput v2.0.0 (removed statusOverride and redundant hasX booleans in favor of clean nullable props). v1.0.0: Initial release of CurrencyInput built on NumericInput with Euro default icon and International/Indian grouping.