BankTransferFlowController class

Headless controller that drives a multi-step money-transfer flow.

UI layers observe this ChangeNotifier and render each step as it changes. The controller stores the user's inputs (amount, beneficiary, isScheduled, scheduledDate) so they can be read back at any point, e.g. to display a review summary.

Network calls are the host app's responsibility. Use markSuccess and markFailure to propagate API results back into the controller.

Inheritance

Properties

amount Money?
The amount the user entered, or null if not yet set.
no setter
beneficiary BankBeneficiary?
The beneficiary selected by the user, or null if not yet set.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isScheduled bool
Whether the transfer is scheduled for a future date.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheduledDate DateTime?
The scheduled date, or null when isScheduled is false.
no setter
status BankTransferStatus
The latest status emitted by the flow.
no setter
step BankTransferStep
The step currently displayed to the user.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
advance() → void
Advances the flow to the next BankTransferStep.
dispose() → void
Discards any resources used by the object.
inherited
goBack() → void
Navigates back to the previous BankTransferStep.
markFailure(String reason) → void
Marks the transfer as failed and advances the flow to the result step with a human-readable reason.
markSuccess(String referenceNumber) → void
Marks the transfer as successful and advances the flow to the result step with a referenceNumber that the UI can display.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
Resets the controller to its initial state so a new transfer can begin.
setAmount(Money amount) → void
Records the amount the user wants to send and notifies listeners.
setBeneficiary(BankBeneficiary beneficiary) → void
Records the selected beneficiary and notifies listeners.
setScheduled(bool isScheduled, {DateTime? date}) → void
Toggles scheduled transfer mode.
submitPin(String pin) → void
Called when the user confirms their PIN.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited