BankPotContributionSheet class
Manual add-to-pot or withdraw-from-pot flow.
Presents a large amount display, an inline number pad, real-time validation, and a confirm button that triggers the supplied onConfirm callback. Shows a loading spinner while awaiting the async callback.
Use BankPotContributionSheet.show to display the sheet as a modal bottom sheet.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BankPotContributionSheet
Constructors
-
BankPotContributionSheet({required SavingsPot pot, required Future<
void> onConfirm(Money amount), Key? key, bool isWithdrawal = false, Money? availableBalance, VoidCallback? onCancel, String addTitleTemplate = 'Add to {pot}', String withdrawTitleTemplate = 'Withdraw from {pot}', String closeTooltip = 'Close', String maxContributionTemplate = 'Maximum contribution is {amount} to reach your goal', String maxWithdrawalTemplate = 'You can withdraw at most {amount}', String maxAvailableTemplate = 'Cannot exceed available balance of {amount}', String availableTemplate = 'Available: {amount}', String goalSavedTemplate = 'Goal: {target} · Saved: {saved}', String addButtonLabel = 'Add Money', String withdrawButtonLabel = 'Withdraw', String confirmContributionSemanticLabel = 'Confirm contribution', String confirmWithdrawalSemanticLabel = 'Confirm withdrawal', String invalidAmountSemanticLabel = 'Enter a valid amount to continue', String decimalKeySemanticLabel = 'Decimal point', String deleteKeySemanticLabel = 'Delete', BorderRadius? radius, Color? backgroundColor, Color? accentColor, TextStyle? titleStyle, TextStyle? amountStyle, IconData? closeIcon, IconData? deleteKeyIcon, Duration? animationDuration, Curve? animationCurve}) -
const
Properties
- accentColor → Color?
-
Overrides the confirm button and keypad splash accent. Defaults
to the theme primary colour.
final
- addButtonLabel → String
-
Caption of the confirm button in contribution mode. Defaults to
'Add Money'.
final
- addTitleTemplate → String
-
Contribution title template;
{pot}is substituted. Defaults to 'Add to {pot}'.final - amountStyle → TextStyle?
-
Merged over the computed amount display numeral style.
final
- animationCurve → Curve?
-
Overrides the error reveal curve. Defaults to
BankTokens.curveStandard.
final
- animationDuration → Duration?
-
Overrides the error reveal duration. Defaults to
BankTokens.durationFast.
final
- availableBalance → Money?
-
Maximum available balance for withdrawals (e.g. the pot's current balance
or the main account balance).
nullmeans uncapped.final - availableTemplate → String
-
Withdrawal subtitle template;
{amount}is substituted. Defaults to 'Available: {amount}'.final - backgroundColor → Color?
-
Overrides the sheet fill colour. Defaults to the theme surface.
final
- closeIcon → IconData?
-
Overrides the close button glyph. Defaults to Icons.close.
final
- closeTooltip → String
-
Tooltip on the close button. Defaults to 'Close'.
final
- confirmContributionSemanticLabel → String
-
Confirm button semantics in contribution mode. Defaults to
'Confirm contribution'.
final
- confirmWithdrawalSemanticLabel → String
-
Confirm button semantics in withdrawal mode. Defaults to
'Confirm withdrawal'.
final
- decimalKeySemanticLabel → String
-
Semantics of the keypad decimal key. Defaults to 'Decimal point'.
final
- deleteKeyIcon → IconData?
-
Overrides the keypad delete glyph. Defaults to
Icons.backspace_outlined.
final
- deleteKeySemanticLabel → String
-
Semantics of the keypad delete key. Defaults to 'Delete'.
final
- goalSavedTemplate → String
-
Contribution subtitle template;
{target}and{saved}are substituted. Defaults to 'Goal: {target} · Saved: {saved}'.final - hashCode → int
-
The hash code for this object.
no setterinherited
- invalidAmountSemanticLabel → String
-
Confirm button semantics while the amount is invalid. Defaults
to 'Enter a valid amount to continue'.
final
- isWithdrawal → bool
-
When
true, the sheet is in withdrawal mode; otherwise contribution mode.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxAvailableTemplate → String
-
Over-available-balance error template;
{amount}is substituted. Defaults to 'Cannot exceed available balance of {amount}'.final - maxContributionTemplate → String
-
Over-target error template;
{amount}is substituted. Defaults to 'Maximum contribution is {amount} to reach your goal'.final - maxWithdrawalTemplate → String
-
Over-balance withdrawal error template;
{amount}is substituted. Defaults to 'You can withdraw at most {amount}'.final - onCancel → VoidCallback?
-
Called when the user cancels. When
null, only the back gesture closes the sheet.final -
onConfirm
→ Future<
void> Function(Money amount) -
Called with the confirmed Money amount. May be async; a loading state
is shown while it completes.
final
- pot → SavingsPot
-
The target savings pot.
final
- radius → BorderRadius?
-
Overrides the sheet corner radius. Defaults to the theme
sheetRadius.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- titleStyle → TextStyle?
-
Merged over the computed title style
(BankTokens.headlineSmall in onSurface).
final
- withdrawButtonLabel → String
-
Caption of the confirm button in withdrawal mode. Defaults to
'Withdraw'.
final
- withdrawTitleTemplate → String
-
Withdrawal title template;
{pot}is substituted. Defaults to 'Withdraw from {pot}'.final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BankPotContributionSheet> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
Static Methods
-
show(
BuildContext context, {required SavingsPot pot, required Future< void> onConfirm(Money amount), bool isWithdrawal = false, Money? availableBalance, VoidCallback? onCancel}) → Future<void> - Convenience helper to push the sheet as a modal bottom sheet.