BankRoundUpSettingsSheet class

Round-up configuration bottom sheet: toggle, multiplier, and destination pot picker.

The sheet is stateless with respect to persistence; callers own the state and supply it via the constructor parameters. Changes are surfaced through the respective callbacks.

Use BankRoundUpSettingsSheet.show to display the sheet as a modal bottom sheet.

Inheritance

Constructors

BankRoundUpSettingsSheet({required bool isEnabled, required int multiplier, required List<SavingsPot> availablePots, required ValueChanged<bool> onEnabledChanged, required ValueChanged<int> onMultiplierChanged, required ValueChanged<String?> onPotSelected, Key? key, String? selectedPotId, String title = 'Round Up Spare Change', String multiplierSectionLabel = 'Round up by', String potSectionLabel = 'Save to', String emptyPotsLabel = 'No savings pots available. Create a pot first.', String goalTemplate = 'Goal: {amount}', String potSemanticTemplate = '{pot}, goal {amount}', String multiplierTemplate = '{n}×', String multiplierSemanticTemplate = '{n}x multiplier', String enabledSemanticLabel = 'Round Up enabled', String disabledSemanticLabel = 'Round Up disabled', String explanationTemplate = 'We\'ll round up every purchase to the ' 'nearest £1 and save the difference{multiplier} automatically.', BorderRadius? radius, Color? backgroundColor, Color? accentColor, TextStyle? titleStyle, IconData? titleIcon, IconData? potIcon, IconData? selectedIcon, IconData? infoIcon, Duration? animationDuration, Curve? animationCurve})
const

Properties

accentColor Color?
Overrides the switch, chip, and pot picker accent. Defaults to the theme primary colour.
final
animationCurve Curve?
Overrides the enable/disable fade curve. Defaults to BankTokens.curveStandard.
final
animationDuration Duration?
Overrides the enable/disable fade duration. Defaults to BankTokens.durationBase.
final
availablePots List<SavingsPot>
Savings pots the user may direct round-ups into.
final
backgroundColor Color?
Overrides the sheet fill colour. Defaults to the theme surface.
final
disabledSemanticLabel String
Switch semantics while round-ups are off. Defaults to 'Round Up disabled'.
final
emptyPotsLabel String
Empty state shown when availablePots is empty. Defaults to 'No savings pots available. Create a pot first.'.
final
enabledSemanticLabel String
Switch semantics while round-ups are on. Defaults to 'Round Up enabled'.
final
explanationTemplate String
Explanation shown at the bottom; {multiplier} is substituted with the multiplied-by suffix (empty at 1x). Defaults to the built-in English copy.
final
goalTemplate String
Pot goal line template; {amount} is substituted. Defaults to 'Goal: {amount}'.
final
hashCode int
The hash code for this object.
no setterinherited
infoIcon IconData?
Overrides the explanation glyph. Defaults to BankIcons.info.
final
isEnabled bool
Whether round-ups are currently enabled.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
multiplier int
Current round-up multiplier. Must be one of 1, 2, 5, or 10.
final
multiplierSectionLabel String
Label above the multiplier chips. Defaults to 'Round up by'.
final
multiplierSemanticTemplate String
Multiplier chip semantics template; {n} is substituted. Defaults to '{n}x multiplier'.
final
multiplierTemplate String
Multiplier chip text template; {n} is substituted. Defaults to '{n}' followed by a multiplication sign.
final
onEnabledChanged ValueChanged<bool>
Invoked when the user toggles the round-up switch.
final
onMultiplierChanged ValueChanged<int>
Invoked when the user selects a multiplier chip.
final
onPotSelected ValueChanged<String?>
Invoked when the user picks a destination pot. null when deselected.
final
potIcon IconData?
Overrides the pot row glyph. Defaults to BankIcons.pot.
final
potSectionLabel String
Label above the pot picker. Defaults to 'Save to'.
final
potSemanticTemplate String
Pot row semantics template; {pot} and {amount} are substituted. Defaults to '{pot}, goal {amount}'.
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
selectedIcon IconData?
Overrides the selected pot glyph. Defaults to Icons.check_circle.
final
selectedPotId String?
The SavingsPot.id of the currently selected destination pot.
final
title String
Heading of the sheet. Defaults to 'Round Up Spare Change'.
final
titleIcon IconData?
Overrides the heading glyph. Defaults to BankIcons.roundUp.
final
titleStyle TextStyle?
Merged over the computed heading style (BankTokens.headlineSmall in onSurface).
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<BankRoundUpSettingsSheet>
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 bool isEnabled, required int multiplier, required List<SavingsPot> availablePots, required ValueChanged<bool> onEnabledChanged, required ValueChanged<int> onMultiplierChanged, required ValueChanged<String?> onPotSelected, String? selectedPotId}) Future<void>
Shows the sheet as a modal bottom sheet.