BankPointsHubCard class

Loyalty points hero card: the entry point of a rewards programme hub.

Shows the member's points balance in hero numerals with NumeralStyle-aware digit grouping, an optional cash-equivalent line, an optional earn-rate microtext, a warning chip when a batch of points is about to expire, and a row of action pills (Redeem, Gift cards, Donate, Invest, or whatever actions you provide).

The loyalty points hub pattern found in leading banking apps.

The points balance and the cash-value line are masked when privacy mode is active on the ambient BankUiScope, mirroring how account balances behave across the kit. All colours, radii, spacing, and text styles come from BankThemeData and BankTokens.

BankPointsHubCard(
  pointsBalance: 12450,
  cashValueLabel: '= SAR 42.50',
  earnRateLabel: '1 point per SAR 4',
  expiringPoints: 500,
  expiringOn: DateTime(2026, 8, 1),
  actions: const [
    BankPointsAction(
      id: 'redeem',
      label: 'Redeem',
      icon: Icons.redeem_outlined,
    ),
    BankPointsAction(
      id: 'gift_cards',
      label: 'Gift cards',
      icon: BankIcons.gift,
    ),
    BankPointsAction(
      id: 'donate',
      label: 'Donate',
      icon: Icons.volunteer_activism_outlined,
    ),
    BankPointsAction(
      id: 'invest',
      label: 'Invest',
      icon: BankIcons.investment,
    ),
  ],
  onAction: (String actionId) => debugPrint('tapped $actionId'),
)
Inheritance

Constructors

BankPointsHubCard({required int pointsBalance, required List<BankPointsAction> actions, Key? key, String pointsLabel = 'points', String? cashValueLabel, String? earnRateLabel, int? expiringPoints, DateTime? expiringOn, void onAction(String actionId)?, String expireVerbLabel = 'expire'})
Creates a loyalty points hero card.
const

Properties

actions List<BankPointsAction>
Quick actions rendered as icon + label pills below the balance. Pass an empty list to hide the action row entirely.
final
cashValueLabel String?
Optional preformatted cash equivalent, e.g. '= SAR 42.50'. Masked together with the balance when privacy mode is active.
final
earnRateLabel String?
Optional earn-rate microtext, e.g. '1 point per SAR 4'.
final
expireVerbLabel String
Verb inserted in the expiry chip between the points count and the date, e.g. '500 points expire 1 Aug'. Override to localise.
final
expiringOn DateTime?
Date on which expiringPoints expire.
final
expiringPoints int?
Number of points in the batch that expires next. The expiry chip is shown only when both this and expiringOn are provided and this value is greater than zero.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onAction → void Function(String actionId)?
Called with the tapped action's BankPointsAction.id. When null, the action pills render in a disabled state.
final
pointsBalance int
Current points balance, rendered in hero numerals with locale-style digit grouping converted to the active NumeralStyle.
final
pointsLabel String
Unit label shown next to the balance, e.g. 'points' or 'miles'.
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