BankFamilyCardTile class
Management row for a dependent or teen card, one per family member.
Use it in a family or dependents section of a card-management screen, one tile per BankFamilyMemberCard. Each tile (72 px minimum height) shows a BankEmblem with the member's initials, the member's name with an optional age chip, the card's last four digits, a thin spent/limit progress bar (switching to BankTokens.warning above 80 percent), and a caption built from limitTemplate.
The trailing freeze Switch drives onFreezeToggle and shows an inline progress indicator while the returned future is pending; the resolved value becomes the displayed frozen state, so a backend that rejects the change simply resolves with the previous value. While frozen, the row content dims and a frost chip appears next to the name, matching the frozen treatment used across the kit.
onTap makes the whole row tappable and adds a trailing chevron, typically opening the full card controls. onLimits adds a "Set limits" TextButton under the progress bar.
Monetary amounts respect privacy mode: when
BankUiScopeData.privacyEnabled is true, both amounts in the
limitTemplate caption are replaced with the scope's hidden-balance
placeholder.
BankFamilyCardTile(
member: member,
onFreezeToggle: (frozen) =>
cardApi.setFrozen(member.id, frozen: frozen),
onTap: () => openCardControls(member),
onLimits: () => openSpendLimits(member),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BankFamilyCardTile
Constructors
-
BankFamilyCardTile({required BankFamilyMemberCard member, required Future<
bool> onFreezeToggle(bool frozen), Key? key, VoidCallback? onTap, VoidCallback? onLimits, String limitTemplate = '{spent} of {limit} this month', String setLimitsLabel = 'Set limits', String freezeSwitchLabel = 'Freeze card', String cardNumberPrefix = '•• ', EdgeInsetsGeometry? padding, BorderRadius? radius, Color? backgroundColor, Color? accentColor, Color? frozenChipBackgroundColor, Color? frozenChipForegroundColor, TextStyle? titleStyle, TextStyle? subtitleStyle, IconData? freezeChipIcon, IconData? notificationIcon, IconData? chevronIcon, Widget? leading, String? semanticLabel, double? minHeight, Duration? animationDuration, Curve? animationCurve}) -
const
Properties
- accentColor → Color?
-
Overrides the accent used by the progress bar, freeze switch,
pending spinner, and "Set limits" button. Defaults to the theme
primary color.
final
- animationCurve → Curve?
-
Overrides the pending/switch cross-fade curve. Defaults to
BankTokens.curveStandard.
final
- animationDuration → Duration?
-
Overrides the pending/switch cross-fade duration. Defaults to
BankTokens.durationFast.
final
- backgroundColor → Color?
-
Overrides the tile background color. Defaults to transparent.
final
- cardNumberPrefix → String
-
Prefix rendered before the card's last four digits. Defaults to
'•• '.final - chevronIcon → IconData?
-
Overrides the trailing chevron shown when onTap is set. Defaults
to BankIcons.forward.
final
- freezeChipIcon → IconData?
-
Overrides the frost chip glyph. Defaults to BankIcons.cardFreeze.
final
- freezeSwitchLabel → String
-
Semantics label for the trailing freeze Switch.
final
- frozenChipBackgroundColor → Color?
-
Overrides the frost chip background. Defaults to the kit's
ice-blue
Color(0xFFB3E5FC).final - frozenChipForegroundColor → Color?
-
Overrides the frost chip text and icon color. Defaults to
Color(0xFF333333).final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
Replaces the leading emblem. Defaults to a 44 px BankEmblem with
the member's initials.
final
- limitTemplate → String
-
Template for the caption under the progress bar. The
{spent}and{limit}placeholders are replaced with formatted amounts.final - member → BankFamilyMemberCard
-
The family member whose card this tile manages.
final
- minHeight → double?
-
Overrides the tile's minimum height. Defaults to 72.
final
- notificationIcon → IconData?
-
Overrides the spend notification glyph next to the card number.
Defaults to BankIcons.notification.
final
-
onFreezeToggle
→ Future<
bool> Function(bool frozen) -
Called when the freeze switch is toggled with the requested state.
final
- onLimits → VoidCallback?
-
When non-null, a "Set limits" TextButton appears under the
progress bar and invokes this callback.
final
- onTap → VoidCallback?
-
Makes the row tappable (e.g. to open full card controls) and shows
a trailing chevron. No chevron is rendered when
null.final - padding → EdgeInsetsGeometry?
-
Overrides the tile's content padding. Defaults to
BankTokens.space4 horizontal by BankTokens.space3 vertical.
final
- radius → BorderRadius?
-
Overrides the ink splash radius. Defaults to the theme cardRadius.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Semantics label for the whole tile. Defaults to none, letting the
child semantics describe the row.
final
- setLimitsLabel → String
-
Label of the TextButton shown when onLimits is provided.
final
- subtitleStyle → TextStyle?
-
Merged over the card number and limit caption style
(BankTokens.bodySmall in the theme onSurfaceVariant color).
final
- titleStyle → TextStyle?
-
Merged over the member name style (BankTokens.labelLarge in the
theme onSurface color), so partial overrides work.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BankFamilyCardTile> -
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