BankBalanceText class

Currency-formatted text that automatically masks when privacy mode is active.

Privacy state is read from the nearest BankUiScope. When BankUiScopeData.privacyEnabled is true, the balance is replaced by BankUiStrings.balanceHidden (default: '••••'). The transition between hidden and visible states is animated with a 150 ms cross-fade.

BankBalanceText(
  money: account.balance,
  size: BankBalanceSize.hero,
  showSign: true,
)
Inheritance

Constructors

BankBalanceText({required Money money, Key? key, TextStyle? style, BankBalanceSize size = BankBalanceSize.large, bool showSign = false, bool compact = false, Duration? animationDuration, Curve? animationCurve, String? semanticLabel})
const

Properties

animationCurve Curve?
Overrides the hidden/visible cross-fade curve. Defaults to BankTokens.curveStandard.
final
animationDuration Duration?
Overrides the hidden/visible cross-fade duration. Defaults to BankTokens.durationFast.
final
compact bool
When true, uses compact notation (e.g. £1.2K instead of £1,200.00).
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
money Money
The monetary value to display.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
Overrides the computed accessibility label ('Balance: X', or 'Balance hidden' while privacy mode is active).
final
showSign bool
When true a leading + is prepended to positive amounts.
final
size BankBalanceSize
Controls which numeral-typography scale is used.
final
style TextStyle?
Override for the text style. When null, a style is derived from size and BankThemeData.onSurface colour.
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