BankErrorStateView class

Error state with a specific reason.

Never uses a generic "Something went wrong" message. Callers must supply a title and message that explain what failed and why. An optional onRetry and onContactSupport callback are shown as action buttons when non-null.

Layout: a vertically centred Column with an illustration slot, title in BankTokens.headlineSmall, message in BankTokens.bodyMedium with BankThemeData.onSurfaceVariant colour, then action buttons. When illustration is null the slot renders the error glyph inside a soft danger-tinted 72 px circle (brightness-aware), so the error moment never reads as a bare wireframe.

BankErrorStateView(
  title: 'Transfer failed',
  message: "We could not reach the recipient's bank. "
      'Please try again later.',
  onRetry: () => bloc.add(RetryTransferEvent()),
  onContactSupport: () => launchSupportChat(),
)
Inheritance

Constructors

BankErrorStateView({required String title, required String message, Key? key, String retryLabel = 'Retry', String? supportLabel, VoidCallback? onRetry, VoidCallback? onContactSupport, Widget? icon, Widget? illustration, EdgeInsetsGeometry? padding, Color? accentColor, TextStyle? titleStyle, TextStyle? messageStyle, String? semanticLabel})
const

Properties

accentColor Color?
Background of the retry button. Defaults to BankThemeData.primary.
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
Custom icon widget rendered inside the default illustration circle. Defaults to Icons.error_outline in the brightness-appropriate BankTokens.danger / BankTokens.dangerDark colour at 32 px.
final
illustration Widget?
Replaces the whole illustration slot above the title (icon and tinted circle included). Bank UI Kit bundles no illustration assets; supply brand artwork here.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
message String
A specific explanation of the error: never a generic fallback.
final
messageStyle TextStyle?
Merged over the computed message style (BankTokens.bodyMedium in BankThemeData.onSurfaceVariant).
final
onContactSupport VoidCallback?
Callback for the contact-support button. Button is omitted when null.
final
onRetry VoidCallback?
Callback for the retry button. Button is omitted when null.
final
padding EdgeInsetsGeometry?
Overrides the content padding. Defaults to EdgeInsets.symmetric(horizontal: BankTokens.space8).
final
retryLabel String
Label for the retry action button.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabel String?
Container semantics label for the whole view. Defaults to none (children are read individually, as today).
final
supportLabel String?
Label for the support action button.
final
title String
Short title describing what went wrong.
final
titleStyle TextStyle?
Merged over the computed title style (BankTokens.headlineSmall in BankThemeData.onSurface).
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