BankSavingsPotCard class

Goal-based sub-account card with progress ring, target, and optional badges.

Displays a SavingsPot's name, current balance, target goal, progress towards the target, interest rate badge (if applicable), own-account-number badge, and a shared-pot indicator. Optional "Add" and "Withdraw" actions appear in a bottom row when the respective callbacks are provided.

Supply itemBuilder to completely override the card's default content.

Inheritance

Constructors

BankSavingsPotCard({required SavingsPot pot, Key? key, VoidCallback? onTap, VoidCallback? onAddMoney, VoidCallback? onWithdraw, Widget itemBuilder(BuildContext, SavingsPot)?, String rateSuffix = 'AER', String profitRateSuffix = 'expected profit', String goalTemplate = 'of {amount} goal', String ownAccountLabel = 'Own account', String membersTemplate = '{n} members', String addLabel = 'Add', String withdrawLabel = 'Withdraw', String? semanticLabel, String ownAccountSemanticLabel = 'Has own account number', String sharedSemanticTemplate = 'Shared pot with {n} members', String addSemanticTemplate = 'Add money to {pot}', String withdrawSemanticTemplate = 'Withdraw from {pot}', EdgeInsetsGeometry? padding, BorderRadius? radius, Color? backgroundColor, Color? accentColor, Gradient? gradient, List<BoxShadow>? shadow, TextStyle? titleStyle, TextStyle? subtitleStyle, TextStyle? amountStyle, IconData? ownAccountIcon, IconData? sharedIcon, IconData? addIcon, IconData? withdrawIcon, double? ringSize})
const

Properties

accentColor → Color?
Overrides the ring, balance, and add-action accent. Defaults to the theme primary colour.
final
addIcon → IconData?
Overrides the add action glyph. Defaults to BankIcons.add.
final
addLabel → String
Caption of the add action. Defaults to 'Add'.
final
addSemanticTemplate → String
Add action semantics template; {pot} is substituted. Defaults to 'Add money to {pot}'.
final
amountStyle → TextStyle?
Merged over the computed balance numeral style.
final
backgroundColor → Color?
Overrides the card fill colour. Defaults to the theme surface.
final
goalTemplate → String
Target line template; {amount} is substituted. Defaults to 'of {amount} goal'.
final
gradient → Gradient?
Overrides the progress ring gradient. Defaults to the theme accentGradient.
final
hashCode → int
The hash code for this object.
no setterinherited
itemBuilder → Widget Function(BuildContext, SavingsPot)?
When non-null, completely overrides the card content. Receives the BuildContext and the SavingsPot and must return a widget tree that fills the card.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
membersTemplate → String
Shared badge template; {n} is substituted with the member count. Defaults to '{n} members'.
final
onAddMoney → VoidCallback?
Called when the user taps the "Add" action button.
final
onTap → VoidCallback?
Called when the card is tapped.
final
onWithdraw → VoidCallback?
Called when the user taps the "Withdraw" action button.
final
ownAccountIcon → IconData?
Overrides the own-account badge glyph. Defaults to BankIcons.account.
final
ownAccountLabel → String
Caption of the own-account badge. Defaults to 'Own account'.
final
ownAccountSemanticLabel → String
Semantics of the own-account badge. Defaults to 'Has own account number'.
final
padding → EdgeInsetsGeometry?
Overrides the card content padding. Defaults to space4 all round.
final
pot → SavingsPot
The savings pot to display.
final
profitRateSuffix → String
Suffix on the rate badge when islamicFinanceMode is on. Defaults to 'expected profit'.
final
radius → BorderRadius?
Overrides the card corner radius. Defaults to the theme cardRadius.
final
rateSuffix → String
Suffix on the rate badge in conventional mode. Defaults to 'AER'.
final
ringSize → double?
Diameter of the progress ring. Defaults to 56.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel → String?
Overrides the card-level semantics. Defaults to a label built from the pot name, amounts, and progress.
final
shadow → List<BoxShadow>?
Overrides the card shadow. Defaults to the theme glow when enabled, else the resting card shadow for the ambient background brightness (BankTokens.shadowCardFor); pass const [] to flatten.
final
sharedIcon → IconData?
Overrides the shared badge glyph. Defaults to BankIcons.accountJoint.
final
sharedSemanticTemplate → String
Shared badge semantics template; {n} is substituted. Defaults to 'Shared pot with {n} members'.
final
subtitleStyle → TextStyle?
Merged over the computed target-line style (BankTokens.bodySmall in onSurfaceVariant).
final
titleStyle → TextStyle?
Merged over the computed pot-name style (BankTokens.labelLarge in onSurface).
final
withdrawIcon → IconData?
Overrides the withdraw action glyph. Defaults to BankIcons.receive.
final
withdrawLabel → String
Caption of the withdraw action. Defaults to 'Withdraw'.
final
withdrawSemanticTemplate → String
Withdraw action semantics template; {pot} is substituted. Defaults to 'Withdraw from {pot}'.
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