BankAppGateScreen class
Full-screen blocking gate shown before the app can be used.
BankAppGateScreen is the kit's single unified "you cannot come in right now" screen. It covers scheduled maintenance, connectivity loss, forced updates, security blocks, fixable device issues, and sign-in queues, selected via reason (a BankAppGateReason).
The widget performs no detection or networking itself: the host app decides when to show it and injects reason, queuePosition, and resumesAt. Every piece of copy has a calm English default per reason and every one of them is overridable.
Layout: a vertically centred, scrollable column on a BankThemeData.background ColoredBox inside a SafeArea: icon or illustration, title, body, then (when supplied) remediation steps, the queue block, or the resumesAt countdown, a stillWorking checklist card, a tappable referenceCode chip that copies via Clipboard, primary and secondary actions, a support row, and a version footer pinned to the bottom with a Spacer.
The whole column fades and slides in 12 px on mount; the entrance
and all AnimatedSwitcher transitions are skipped when
MediaQuery.disableAnimationsOf is true. No looping or pulsing
decoration is ever used: money-blocked screens stay calm. All state
distinctions are conveyed by icon plus text, never colour alone.
BankAppGateScreen.maintenance(
resumesAt: DateTime.now().add(const Duration(minutes: 45)),
appVersion: '4.12.0',
supportPhoneLabel: 'Call us on 0800 123 456',
onContactSupport: () => launchSupportChat(),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BankAppGateScreen
Constructors
-
BankAppGateScreen({required BankAppGateReason reason, Key? key, String? title, String? body, IconData? icon, Widget? illustration, String? primaryActionLabel, VoidCallback? onPrimaryAction, String? secondaryActionLabel, VoidCallback? onSecondaryAction, List<
String> ? steps, List<String> ? stillWorking, String stillWorkingTitle = _kStillWorkingTitle, String? moneySafetyLine, String? referenceCode, String referenceCodeHint = _kReferenceCodeHint, String copiedLabel = _kCopiedLabel, Widget? supportContact, String? supportPhoneLabel, VoidCallback? onContactSupport, IconData? supportIcon, String? appVersion, String versionPrefix = _kVersionPrefix, DateTime? lastUpdatedAt, String lastUpdatedPrefix = _kLastUpdatedPrefix, DateTime? resumesAt, String backByLabel = _kBackByLabel, String overrunLabel = _kOverrunLabel, DateTime clock()?, int? queuePosition, int? queueInitialPosition, Duration? estimatedWait, String queueKeepPlaceLine = _kQueueKeepPlaceLine, String queuePositionLine(int position, Duration? estimatedWait)?, EdgeInsetsGeometry? padding, Color? backgroundColor, Color? accentColor, TextStyle? titleStyle, TextStyle? bodyStyle, Duration? animationDuration, Curve? animationCurve, String? semanticLabel}) -
Creates an app gate screen for
reason.const -
BankAppGateScreen.forceUpdate({required VoidCallback onOpenStore, Key? key, String? installedVersion, String? title, String? body, IconData? icon, Widget? illustration, String? primaryActionLabel = 'Update now', String? secondaryActionLabel = _kUpdateHelpLabel, VoidCallback? onSecondaryAction, List<
String> ? steps, List<String> ? stillWorking, String stillWorkingTitle = _kStillWorkingTitle, String? moneySafetyLine, String? referenceCode, String referenceCodeHint = _kReferenceCodeHint, String copiedLabel = _kCopiedLabel, Widget? supportContact, String? supportPhoneLabel, VoidCallback? onContactSupport, IconData? supportIcon, String versionPrefix = _kVersionPrefix, DateTime? lastUpdatedAt, String lastUpdatedPrefix = _kLastUpdatedPrefix, DateTime? resumesAt, String backByLabel = _kBackByLabel, String overrunLabel = _kOverrunLabel, DateTime clock()?, int? queuePosition, int? queueInitialPosition, Duration? estimatedWait, String queueKeepPlaceLine = _kQueueKeepPlaceLine, String queuePositionLine(int position, Duration? estimatedWait)?, EdgeInsetsGeometry? padding, Color? backgroundColor, Color? accentColor, TextStyle? titleStyle, TextStyle? bodyStyle, Duration? animationDuration, Curve? animationCurve, String? semanticLabel}) -
Force-update gate: a single store call to action wired to
onOpenStore,installedVersionpiped into the version footer, and a help escape hatch as the default secondary label.const -
BankAppGateScreen.maintenance({Key? key, DateTime? resumesAt, String? title, String? body, IconData? icon, Widget? illustration, String? primaryActionLabel, VoidCallback? onPrimaryAction, String? secondaryActionLabel, VoidCallback? onSecondaryAction, List<
String> ? steps, List<String> ? stillWorking = _kStillWorkingDefaults, String stillWorkingTitle = _kStillWorkingTitle, String? moneySafetyLine, String? referenceCode, String referenceCodeHint = _kReferenceCodeHint, String copiedLabel = _kCopiedLabel, Widget? supportContact, String? supportPhoneLabel, VoidCallback? onContactSupport, IconData? supportIcon, String? appVersion, String versionPrefix = _kVersionPrefix, DateTime? lastUpdatedAt, String lastUpdatedPrefix = _kLastUpdatedPrefix, String backByLabel = _kBackByLabel, String overrunLabel = _kOverrunLabel, DateTime clock()?, int? queuePosition, int? queueInitialPosition, Duration? estimatedWait, String queueKeepPlaceLine = _kQueueKeepPlaceLine, String queuePositionLine(int position, Duration? estimatedWait)?, EdgeInsetsGeometry? padding, Color? backgroundColor, Color? accentColor, TextStyle? titleStyle, TextStyle? bodyStyle, Duration? animationDuration, Curve? animationCurve, String? semanticLabel}) -
Maintenance gate: warm copy, an expected-back countdown via
resumesAt, a default "Still working" checklist, and the money safety line switched on.const -
BankAppGateScreen.offline({Key? key, VoidCallback? onRetry, String? title, String? body, IconData? icon, Widget? illustration, String? primaryActionLabel = 'Try again', String? secondaryActionLabel, VoidCallback? onSecondaryAction, List<
String> ? steps, List<String> ? stillWorking, String stillWorkingTitle = _kStillWorkingTitle, String? moneySafetyLine, String? referenceCode, String referenceCodeHint = _kReferenceCodeHint, String copiedLabel = _kCopiedLabel, Widget? supportContact, String? supportPhoneLabel, VoidCallback? onContactSupport, IconData? supportIcon, String? appVersion, String versionPrefix = _kVersionPrefix, DateTime? lastUpdatedAt, String lastUpdatedPrefix = _kLastUpdatedPrefix, DateTime? resumesAt, String backByLabel = _kBackByLabel, String overrunLabel = _kOverrunLabel, DateTime clock()?, int? queuePosition, int? queueInitialPosition, Duration? estimatedWait, String queueKeepPlaceLine = _kQueueKeepPlaceLine, String queuePositionLine(int position, Duration? estimatedWait)?, EdgeInsetsGeometry? padding, Color? backgroundColor, Color? accentColor, TextStyle? titleStyle, TextStyle? bodyStyle, Duration? animationDuration, Curve? animationCurve, String? semanticLabel}) -
Offline gate: explains the connection is the cause and wires a
'Try again' primary action to
onRetry.const -
BankAppGateScreen.rootedDevice({Key? key, String? referenceCode, String? title, String? body, IconData? icon, Widget? illustration, String? primaryActionLabel, VoidCallback? onPrimaryAction, String? secondaryActionLabel, VoidCallback? onSecondaryAction, List<
String> ? steps, List<String> ? stillWorking, String stillWorkingTitle = _kStillWorkingTitle, String? moneySafetyLine, String referenceCodeHint = _kReferenceCodeHint, String copiedLabel = _kCopiedLabel, Widget? supportContact, String? supportPhoneLabel, VoidCallback? onContactSupport, IconData? supportIcon, String? appVersion, String versionPrefix = _kVersionPrefix, DateTime? lastUpdatedAt, String lastUpdatedPrefix = _kLastUpdatedPrefix, DateTime? resumesAt, String backByLabel = _kBackByLabel, String overrunLabel = _kOverrunLabel, DateTime clock()?, int? queuePosition, int? queueInitialPosition, Duration? estimatedWait, String queueKeepPlaceLine = _kQueueKeepPlaceLine, String queuePositionLine(int position, Duration? estimatedWait)?, EdgeInsetsGeometry? padding, Color? backgroundColor, Color? accentColor, TextStyle? titleStyle, TextStyle? bodyStyle, Duration? animationDuration, Curve? animationCurve, String? semanticLabel}) -
Rooted-device gate: deliberately vague copy that leans on the
optional
referenceCodefor support conversations.const -
BankAppGateScreen.vpnDetected({Key? key, String? referenceCode, String? title, String? body, IconData? icon, Widget? illustration, String? primaryActionLabel, VoidCallback? onPrimaryAction, String? secondaryActionLabel, VoidCallback? onSecondaryAction, List<
String> ? steps, List<String> ? stillWorking, String stillWorkingTitle = _kStillWorkingTitle, String? moneySafetyLine, String referenceCodeHint = _kReferenceCodeHint, String copiedLabel = _kCopiedLabel, Widget? supportContact, String? supportPhoneLabel, VoidCallback? onContactSupport, IconData? supportIcon, String? appVersion, String versionPrefix = _kVersionPrefix, DateTime? lastUpdatedAt, String lastUpdatedPrefix = _kLastUpdatedPrefix, DateTime? resumesAt, String backByLabel = _kBackByLabel, String overrunLabel = _kOverrunLabel, DateTime clock()?, int? queuePosition, int? queueInitialPosition, Duration? estimatedWait, String queueKeepPlaceLine = _kQueueKeepPlaceLine, String queuePositionLine(int position, Duration? estimatedWait)?, EdgeInsetsGeometry? padding, Color? backgroundColor, Color? accentColor, TextStyle? titleStyle, TextStyle? bodyStyle, Duration? animationDuration, Curve? animationCurve, String? semanticLabel}) -
VPN-detected gate: deliberately vague copy that leans on the
optional
referenceCodefor support conversations.const
Properties
- accentColor → Color?
-
Tints the icon block and the queue progress bar. Defaults to
BankTokens.danger for the adversarial security reasons and
BankThemeData.primary otherwise.
final
- animationCurve → Curve?
-
Curve of the entrance fade and queue transitions. Defaults to
BankTokens.curveDecelerate.
final
- animationDuration → Duration?
-
Duration of the entrance fade and queue transitions. Defaults to
BankTokens.durationBase.
final
- appVersion → String?
-
App version shown muted in the footer (e.g. 'Version 4.12.0').
final
- backByLabel → String
-
Prefix of the resumesAt line. Defaults to 'Back by around'.
final
- backgroundColor → Color?
-
Overrides the screen background. Defaults to
BankThemeData.background.
final
- body → String?
-
Overrides the default body copy for reason.
final
- bodyStyle → TextStyle?
-
Merged over the computed body style (BankTokens.bodyMedium in
BankThemeData.onSurfaceVariant).
final
- clock → DateTime Function()?
-
Time source for the resumesAt countdown. Defaults to
DateTime.now; inject a fixed clock in tests and screenshots.
final
- copiedLabel → String
-
Transient label shown for two seconds after the referenceCode
is copied. Defaults to 'Copied'.
final
- estimatedWait → Duration?
-
Estimated remaining wait, appended to the queue position line.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
Overrides the default icon for reason.
final
- illustration → Widget?
-
Replaces the icon block entirely when non-null. Shown with a
maximum height of 180 px.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lastUpdatedAt → DateTime?
-
Timestamp of the last status update, shown in the footer via
BankDateFormatter.formatTime as 'Last updated HH:mm'.
final
- lastUpdatedPrefix → String
-
Prefix of the lastUpdatedAt footer line. Defaults to
'Last updated'.
final
- moneySafetyLine → String?
-
Short reassurance line in BankTokens.bodySmall. Defaults to
'Your money is safe.' for BankAppGateReason.maintenance and
BankAppGateReason.offline, and to nothing otherwise.
final
- onContactSupport → VoidCallback?
-
Called when the built-in support row is tapped. When null the
row renders as plain text.
final
- onPrimaryAction → VoidCallback?
-
Called when the primary action is tapped. The button is hidden
when this is null.
final
- onSecondaryAction → VoidCallback?
-
Called when the secondary action is tapped. The button is hidden
when this is null.
final
- overrunLabel → String
-
Shown instead of a negative countdown once resumesAt passes.
Defaults to 'Taking a little longer than expected'.
final
- padding → EdgeInsetsGeometry?
-
Overrides the outer content padding. Defaults to
EdgeInsets.symmetric(horizontal: BankTokens.space8).final - primaryActionLabel → String?
-
Label for the primary FilledButton. The button is shown only
when both this and onPrimaryAction are non-null.
final
- queueInitialPosition → int?
-
Queue position when the user joined; when provided (with
queuePosition) a determinate LinearProgressIndicator shows
progress towards the front of the queue.
final
- queueKeepPlaceLine → String
-
Reassurance line under the queue block. Defaults to
"We'll bring you in automatically. Your place is saved."
final
- queuePosition → int?
-
Current queue position for BankAppGateReason.queueFull.
final
- queuePositionLine → String Function(int position, Duration? estimatedWait)?
-
Builds the queue position line from queuePosition and
estimatedWait. When null a default English line is used, e.g.
'You are number 214 in line, about 2 minutes'.
final
- reason → BankAppGateReason
-
Why the app is blocked. Drives every default on this screen.
final
- referenceCode → String?
-
Support reference code rendered as a tappable chip that copies
the code to the clipboard.
final
- referenceCodeHint → String
-
Helper line under the referenceCode chip. Defaults to
'Quote this code if you contact us'.
final
- resumesAt → DateTime?
-
When the service is expected back. Renders backByLabel plus
BankDateFormatter.formatTime and a live countdown driven by a
Timer that ticks every second while under one minute remains
and every minute otherwise.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondaryActionLabel → String?
-
Label for the secondary TextButton below the primary action.
final
- semanticLabel → String?
-
Overrides the root semantics label. Defaults to
'
<resolved title>.<resolved body>'.final -
steps
→ List<
String> ? -
Numbered remediation steps rendered start-aligned between the
body and the actions. Defaults to fix-it steps for
BankAppGateReason.clockSkew and BankAppGateReason.developerMode.
final
-
stillWorking
→ List<
String> ? -
Items for the "Still working" checklist card, rendered with
BankIcons.success bullets (e.g.
['Card payments', 'ATM withdrawals', 'Phone banking']).final - stillWorkingTitle → String
-
Heading of the stillWorking card. Defaults to 'Still working'.
final
- supportContact → Widget?
-
Free-form support slot rendered instead of the built-in support
row when non-null.
final
- supportIcon → IconData?
-
Icon of the built-in support row. Defaults to
Icons.phone_outlined.
final
- supportPhoneLabel → String?
-
Label of the built-in support row (e.g. a phone number). The row
is hidden when both this and supportContact are null.
final
- title → String?
-
Overrides the default title for reason.
final
- titleStyle → TextStyle?
-
Merged over the computed title style
(BankTokens.headlineMedium in BankThemeData.onBackground).
final
- versionPrefix → String
-
Prefix of the appVersion footer line. Defaults to 'Version'.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BankAppGateScreen> -
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