BankTransferResultScreen class
Full-screen success or failure state shown after a transfer completes.
On success, plays BankSuccessAnimation with confetti, then shows the transfer amount, beneficiary name, and reference number. On failure, shows a red error icon and the failureReason.
Action buttons are conditionally rendered based on which callbacks are provided.
BankTransferResultScreen(
isSuccess: true,
amount: Money.fromDouble(250, 'GBP'),
beneficiaryName: 'Alice Mensah',
referenceNumber: 'TXN-20240101-001234',
onDone: () => Navigator.of(context).pop(),
onShareReceipt: () => shareReceipt(),
onNewTransfer: () => Navigator.of(context).push(newTransferRoute),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BankTransferResultScreen
Constructors
- BankTransferResultScreen({required bool isSuccess, required VoidCallback onDone, Key? key, Money? amount, String? beneficiaryName, String? referenceNumber, String? failureReason, VoidCallback? onNewTransfer, Color? backgroundColor, EdgeInsetsGeometry? padding, TextStyle? titleStyle, TextStyle? beneficiaryStyle, TextStyle? amountStyle, TextStyle? referenceStyle, TextStyle? failureReasonStyle, IconData errorIcon = Icons.error_outline, Color? errorColor, double? successAnimationSize, bool showConfetti = true, IconData newTransferIcon = Icons.add, Color? buttonColor, Color? buttonForegroundColor, BorderRadius? buttonRadius, String successSemanticLabel = 'Transfer sent successfully', String failureSemanticLabel = 'Transfer failed', String toLabel = 'To', String referenceLabel = 'Ref: ', String referenceSemanticPrefix = 'Reference number: ', String newTransferLabel = 'New transfer', String doneLabel = 'Done'})
-
const
Properties
- amount → Money?
-
The amount transferred. Shown below the animation on success.
final
- amountStyle → TextStyle?
-
Merged over the amount style
(BankTokens.headlineMedium in onSurface).
final
- backgroundColor → Color?
-
Overrides the screen background color. Defaults to the theme background.
final
- beneficiaryName → String?
-
Name of the beneficiary who received the transfer. Shown on success.
final
- beneficiaryStyle → TextStyle?
-
Merged over the beneficiary line style
(BankTokens.bodyLarge in onSurfaceVariant).
final
-
Overrides the primary button background. Defaults to the theme primary.
final
-
Overrides the primary button foreground. Defaults to the theme
onPrimary.
final
-
Overrides the button corner radius. Defaults to the theme buttonRadius.
final
- doneLabel → String
-
Label of the primary done button. Defaults to
'Done'.final - errorColor → Color?
-
Overrides the failure icon color. Defaults to
BankTokens.danger.final - errorIcon → IconData
-
Overrides the failure icon. Defaults to
Icons.error_outline.final - failureReason → String?
-
Human-readable failure reason. Shown on failure.
final
- failureReasonStyle → TextStyle?
-
Merged over the failure reason style
(BankTokens.bodyMedium in onSurfaceVariant).
final
- failureSemanticLabel → String
-
Semantics label on the failure icon. Defaults to
'Transfer failed'.final - hashCode → int
-
The hash code for this object.
no setterinherited
- isSuccess → bool
-
truefor a success state;falsefor a failure state.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- newTransferIcon → IconData
-
Overrides the new-transfer button icon. Defaults to
Icons.add.final - newTransferLabel → String
-
Label of the new-transfer button. Defaults to
'New transfer'.final - onDone → VoidCallback
-
Called when the primary "Done" button is tapped.
final
- onNewTransfer → VoidCallback?
-
When non-null, a secondary "New transfer" button is shown.
final
-
When non-null, a secondary "Share receipt" button is shown.
final
- padding → EdgeInsetsGeometry?
-
Overrides the screen content padding. Defaults to
EdgeInsets.symmetric(horizontal: space6, vertical: space6).final - referenceLabel → String
-
Prefix before the reference number. Defaults to
'Ref: '.final - referenceNumber → String?
-
Reference number for the transfer. Shown in a smaller style on success.
final
- referenceSemanticPrefix → String
-
Prefix for the reference number semantics label. Defaults to
'Reference number: '.final - referenceStyle → TextStyle?
-
Merged over the reference line style
(BankTokens.bodySmall in onSurfaceVariant).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Overrides the share-receipt button icon. Defaults to
Icons.share_outlined.final -
Label of the share-receipt button. Defaults to
'Share receipt'.final - showConfetti → bool
-
Whether the success animation shows confetti. Defaults to
true.final - successAnimationSize → double?
-
Diameter of the success animation. Defaults to
96.final - successSemanticLabel → String
-
Semantics label on the success animation. Defaults to
'Transfer sent successfully'.final - titleStyle → TextStyle?
-
Merged over the result title style
(BankTokens.headlineLarge in onSurface).
final
- toLabel → String
-
Preposition before the beneficiary name. Defaults to
'To'.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