BankValueDiffRow class

An old-vs-new change display for approval and profile-change review screens.

Shows a single changed field as a labelled row. Use it wherever a reviewer must understand exactly what an approval request modifies: limit increases, beneficiary edits, profile updates, mandate changes.

Provide the previous value via oldValue or oldMoney, and the new value via newValue or newMoney:

  • Both present: the old value struck through, an arrow, then the new value — one grammar, in both BankValueDiffStyle variants.
  • Old absent: the field was added: the new value is shown with a positive '+ Added' chip.
  • New absent: the field was removed: the old value is shown struck through with a '– Removed' chip in the theme's negative colour.

Monetary values render through BankBalanceText (small tier), so they mask automatically when privacy mode is active on the ambient BankUiScope.

Colour encodes meaning, and only on the arrow — see BankValueDiffMeaning and meaning. highlightIncrease is the shorthand for the common case: an increase between two Money values in the same currency reads as BankValueDiffMeaning.adverse.

Assistive technologies announce the row as 'label changed from X to Y' (or the added/removed equivalent); override with semanticLabel for localisation.

For a whole change-set, compose rows with BankValueDiffList, which renders them in a BankSummaryStack-consistent card.

BankValueDiffRow(
  label: 'Daily transfer limit',
  oldMoney: Money.fromDouble(5000, 'USD'),
  newMoney: Money.fromDouble(25000, 'USD'),
  highlightIncrease: true,
)
Inheritance

Constructors

BankValueDiffRow({required String label, Key? key, String? oldValue, String? newValue, Money? oldMoney, Money? newMoney, BankValueDiffStyle style = BankValueDiffStyle.inline, BankValueDiffMeaning meaning = BankValueDiffMeaning.neutral, bool highlightIncrease = false, @Deprecated('No longer rendered: 0.3.0 gave both BankValueDiffStyle variants one ' 'old-to-new grammar with no microlabels. Delete the argument; localise ' 'the spoken row with semanticLabel. Removed in 0.5.0.') String previousLabel = 'Previous', @Deprecated('No longer rendered: 0.3.0 gave both BankValueDiffStyle variants one ' 'old-to-new grammar with no microlabels. Delete the argument; localise ' 'the spoken row with semanticLabel. Removed in 0.5.0.') String newLabel = 'New', String addedLabel = 'Added', String removedLabel = 'Removed', String? semanticLabel, EdgeInsetsGeometry? padding, IconData? arrowIcon, Color? addedColor, Color? removedColor, Color? increaseColor, TextStyle? labelStyle, TextStyle? oldValueStyle, TextStyle? newValueStyle})
Creates an old-vs-new change row.
const

Properties

addedColor Color?
Overrides the "added" chip colour. Defaults to the theme positiveBalance.
final
addedLabel String
Chip text (minus the '+ ' prefix) for added fields.
final
arrowIcon IconData?
Overrides the arrow glyph between old and new values. Defaults to the direction-aware BankIcons.forward (or BankIcons.back in RTL).
final
hashCode int
The hash code for this object.
no setterinherited
highlightIncrease bool
When true and both oldMoney and newMoney are provided in the same currency, a new value greater than the old one is treated as BankValueDiffMeaning.adverse. Enable for limit/amount fields.
final
increaseColor Color?
Overrides the arrow tint for an BankValueDiffMeaning.adverse change. Defaults to the theme pending colour.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String
Name of the changed field (e.g. 'Daily transfer limit').
final
labelStyle TextStyle?
Merged over the field-label style (BankTokens.bodySmall in onSurfaceVariant).
final
meaning BankValueDiffMeaning
What this change means to the reviewer; colours the arrow.
final
newLabel String
No longer rendered. Kept so 0.2.0 call sites still compile. See previousLabel for the migration.
final
newMoney Money?
New monetary value. Mutually exclusive with newValue.
final
newValue String?
New plain-text value. Mutually exclusive with newMoney.
final
newValueStyle TextStyle?
Merged over the new-value style.
final
oldMoney Money?
Previous monetary value. Mutually exclusive with oldValue.
final
oldValue String?
Previous plain-text value. Mutually exclusive with oldMoney.
final
oldValueStyle TextStyle?
Merged over the struck-through old-value style.
final
padding EdgeInsetsGeometry?
Overrides the row padding. Defaults to EdgeInsets.symmetric(vertical: BankTokens.space2).
final
previousLabel String
No longer rendered. Kept so 0.2.0 call sites still compile.
final
removedColor Color?
Overrides the "removed" chip colour. Defaults to the theme negativeBalance, which — unlike the raw BankTokens.danger constant — is already the right red for the ambient brightness.
final
removedLabel String
Chip text (minus the '– ' prefix) for removed fields.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
Overrides the generated semantic announcement ('label changed from X to Y'). Supply for non-English locales.
final
style BankValueDiffStyle
How the old and new values are laid out when both are present.
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