BankHorizontalAccountCard class
A landscape-format bank account card with a built-in 3-D flip animation.
Front face shows the account name, balance, masked number, and account-type icon in a layout controlled by layout. Back face shows the full account details (IBAN / account number, sort code / BIC) with a copy-to-clipboard action.
The card background supports three modes via background:
- BankHorizontalCardBackground.themeGradient: preset accent gradient.
- BankHorizontalCardBackground.solidColor: primaryColor or BankThemeData.primary.
- BankHorizontalCardBackground.image: backgroundImage widget (any ImageProvider: asset, network, memory).
Flip behaviour is fully configurable via trigger, flipButtonBuilder, isFlipped, and onFlip (see BankFlipCard).
BankHorizontalAccountCard(
account: myAccount,
cardholderName: 'Alice Johnson',
background: BankHorizontalCardBackground.image,
backgroundImage: AssetImage('assets/card_bg.jpg'),
trigger: BankFlipTrigger.builtInButton,
layout: BankHorizontalCardLayout.centred,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BankHorizontalAccountCard
Constructors
-
BankHorizontalAccountCard({required BankAccount account, Key? key, String? cardholderName, BankHorizontalCardBackground background = BankHorizontalCardBackground.themeGradient, Color? primaryColor, Color? secondaryColor, ImageProvider<
Object> ? backgroundImage, BoxFit backgroundImageFit = BoxFit.cover, Color? backgroundImageOverlay, BankHorizontalCardLayout layout = BankHorizontalCardLayout.balanceLeft, String? networkLogoAsset, BankFlipTrigger trigger = BankFlipTrigger.tapToFlip, Widget flipButtonBuilder(BuildContext context, VoidCallback flip)?, bool? isFlipped, VoidCallback? onFlip, Duration flipDuration = const Duration(milliseconds: 500), Curve flipCurve = Curves.easeInOutCubic, BankFlipAxis flipAxis = BankFlipAxis.horizontal, double? width, double? height, double? maxWidth, EdgeInsetsGeometry? padding, BorderRadius? radius, Gradient? gradient, Color? foregroundColor, TextStyle? titleStyle, TextStyle? amountStyle, TextStyle? maskedNumberStyle, TextStyle? networkLabelStyle, TextStyle? detailLabelStyle, TextStyle? detailValueStyle, TextStyle? copyHintStyle, IconData? typeIcon, IconData? copyIcon, IconData? copyHintIcon, String? ibanLabel, String? sortCodeLabel, String? currencyLabel, String? copyHintLabel, String? copyActionLabel, String? semanticLabel}) -
const
Properties
- account → BankAccount
-
The account whose data is displayed.
final
- amountStyle → TextStyle?
-
Merged over the balance style (BankThemeData.numeralLarge).
final
- background → BankHorizontalCardBackground
-
Which background mode to apply. Defaults to
BankHorizontalCardBackground.themeGradient.
final
-
backgroundImage
→ ImageProvider<
Object> ? -
Image provider used when background is
BankHorizontalCardBackground.image. Can be AssetImage,
NetworkImage, MemoryImage, etc.
final
- backgroundImageFit → BoxFit
-
How the background image is fitted when background is
BankHorizontalCardBackground.image.
final
- backgroundImageOverlay → Color?
-
Optional colour overlay blended on top of backgroundImage to ensure
text remains readable.
final
- cardholderName → String?
-
Cardholder name shown on front and back. Defaults to BankAccount.name.
final
- copyActionLabel → String?
-
Verb used in the copy-icon semantics, read as
<verb> <row label>. Defaults to 'Copy'.final - copyHintIcon → IconData?
-
Glyph next to the copy hint. Defaults to Icons.touch_app_outlined.
final
- copyHintLabel → String?
-
Copy hint shown on the back face. Defaults to 'Tap values to copy'.
final
- copyHintStyle → TextStyle?
-
Merged over the copy-hint text style (BankTokens.labelSmall).
final
- copyIcon → IconData?
-
Copy-action glyph on back-face rows. Defaults to Icons.copy_outlined.
final
- currencyLabel → String?
-
Label of the currency row. Defaults to 'Currency'.
final
- detailLabelStyle → TextStyle?
-
Merged over the back-face detail-label style (BankTokens.labelSmall).
final
- detailValueStyle → TextStyle?
-
Merged over the back-face detail-value style (BankTokens.bodySmall).
final
- flipAxis → BankFlipAxis
-
Axis of rotation. Defaults to BankFlipAxis.horizontal.
final
- flipButtonBuilder → Widget Function(BuildContext context, VoidCallback flip)?
-
Replaces the default flip button when
trigger == BankFlipTrigger.builtInButton.
final
- flipCurve → Curve
-
Curve of the flip. Defaults to Curves.easeInOutCubic.
final
- flipDuration → Duration
-
Duration of the flip. Defaults to 500 ms.
final
- foregroundColor → Color?
-
Base colour of all text and icons on the card. Defaults to
Colors.white; secondary elements use it at 72% alpha.
final
- gradient → Gradient?
-
Overrides the gradient painted in
BankHorizontalCardBackground.themeGradient mode. Defaults to
BankThemeData.accentGradient, with a primaryColor to
secondaryColor fallback.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Fixed card height. When null (the default) the height is 200 if width
is set, otherwise it scales with the resolved width to preserve the
default 340 x 200 aspect ratio.
final
- ibanLabel → String?
-
Label of the IBAN / account number row. Defaults to 'IBAN / Account'.
final
- isFlipped → bool?
-
External flip state. Pair with onFlip to control from outside.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- layout → BankHorizontalCardLayout
-
Field arrangement on the front face.
final
- maskedNumberStyle → TextStyle?
-
Merged over the masked-number style (BankTokens.bodySmall).
final
- maxWidth → double?
-
Upper bound on the card width when width is null. Defaults to 340,
matching the previous fixed width.
final
- networkLabelStyle → TextStyle?
-
Merged over the fallback network-badge text style
(BankTokens.labelSmall) shown when networkLogoAsset is null.
final
- networkLogoAsset → String?
-
Asset path for the card-network logo (e.g.
'assets/visa.png').final - onFlip → VoidCallback?
-
Called when the flip trigger fires. Required when isFlipped is
provided.
final
- padding → EdgeInsetsGeometry?
-
Content padding of both faces. Defaults to
EdgeInsets.all(BankTokens.space5).final - primaryColor → Color?
-
Primary card colour for BankHorizontalCardBackground.solidColor and the
gradient fallback. Falls back to BankThemeData.primary.
final
- radius → BorderRadius?
-
Corner radius of the card. Defaults to
BorderRadius.circular(16).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondaryColor → Color?
-
Second gradient stop. Falls back to BankThemeData.primaryVariant.
final
- semanticLabel → String?
-
Overrides the card semantics label. Defaults to
Account card: <account name>, balance <balance>.final - sortCodeLabel → String?
-
Label of the sort code / BIC row. Defaults to 'Sort Code / BIC'.
final
- titleStyle → TextStyle?
-
Merged over the account-name style (BankTokens.labelLarge).
final
- trigger → BankFlipTrigger
-
How the flip is triggered. Defaults to BankFlipTrigger.tapToFlip.
final
- typeIcon → IconData?
-
Overrides the account-type glyph. Defaults to the BankIcons glyph
derived from BankAccount.type.
final
- width → double?
-
Fixed card width. When null (the default) the card fills the available
width up to maxWidth (340 when maxWidth is also null), so it renders
at 340 in unconstrained contexts, exactly as older versions did.
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