BankPreapprovedLoanCard class

Pre-approved financing offer card with quick-pick amounts and a one-tap continue action.

Shows the maximum pre-approved amount as a hero figure under an accentGradient header strip (title plus offer badge), quick-pick chips at 25%, 50%, and 100% of the maximum (plus quickAmount when provided), a live estimated monthly installment for the selection (standard amortization over maxMonths, the same math as BankLoanCalculatorCard), a rate and tenor microline, and a full-width CTA that fires onContinue with the selected amount.

The rate label honours islamicFinanceMode (profit rate instead of APR) unless rateLabel overrides it. An expiry countdown chip appears when offerExpires falls within 14 days; once the offer has expired the chips and the CTA are disabled. All digits respect the ambient NumeralStyle, and amounts mask automatically when privacy mode is active.

BankPreapprovedLoanCard(
  maxAmount: Money.fromDouble(250000, 'SAR'),
  annualRate: 0.049,
  maxMonths: 60,
  onContinue: startApplication,
  quickAmount: Money.fromDouble(30000, 'SAR'),
  offerExpires: DateTime.now().add(const Duration(days: 10)),
)
Inheritance

Constructors

BankPreapprovedLoanCard({required Money maxAmount, required double annualRate, required int maxMonths, required void onContinue(Money amount), Key? key, Money? quickAmount, DateTime? offerExpires, String title = 'You are pre-approved', String? rateLabel, String ctaLabel = 'Get the money', String badgeLabel = 'Exclusive offer', String upToLabel = 'Up to', String monthlyLabel = 'Est. monthly payment', String tenorTemplate = 'up to {n} months', String expiresTemplate = 'Expires in {n} days', String expiresTodayLabel = 'Expires today', String expiredLabel = 'Offer expired', String aprLabel = 'APR', String profitRateLabel = 'Profit rate', EdgeInsetsGeometry? padding, BorderRadius? radius, Color? backgroundColor, List<BoxShadow>? shadow, Gradient? gradient, Color? accentColor, IconData? badgeIcon, IconData? expiryIcon, TextStyle? titleStyle, TextStyle? amountStyle, TextStyle? monthlyStyle, Widget? header, Duration? animationDuration, Curve? animationCurve})
const

Properties

accentColor Color?
Accent for the monthly figure, selected chip, and CTA. Defaults to the theme primary.
final
amountStyle TextStyle?
Merged over the hero amount style (numeralHero, onSurface).
final
animationCurve Curve?
Curve of the monthly figure cross-fade. Defaults to BankTokens.curveStandard.
final
animationDuration Duration?
Duration of the monthly figure cross-fade. Defaults to BankTokens.durationFast.
final
annualRate double
Nominal annual rate as a fraction, e.g. 0.049 for 4.9 %.
final
aprLabel String
final
backgroundColor Color?
Overrides the card fill color. Defaults to the theme surface.
final
badgeIcon IconData?
Glyph inside the offer badge. Defaults to BankIcons.success.
final
badgeLabel String
final
ctaLabel String
final
expiredLabel String
final
expiresTemplate String
{n} is substituted with the days remaining.
final
expiresTodayLabel String
final
expiryIcon IconData?
Glyph inside the expiry chip. Defaults to BankIcons.schedule.
final
gradient Gradient?
Overrides the header strip gradient. Defaults to the theme accentGradient (falling back to primary tones).
final
hashCode int
The hash code for this object.
no setterinherited
Replaces the entire gradient header strip. Defaults to the built-in title and badge row.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxAmount Money
The maximum pre-approved financing amount.
final
maxMonths int
The longest available tenor, used for the installment estimate.
final
monthlyLabel String
final
monthlyStyle TextStyle?
Merged over the monthly estimate style (numeralMedium, accent).
final
offerExpires DateTime?
When the offer lapses. A countdown chip renders once this falls within 14 days; past dates disable the card.
final
onContinue → void Function(Money amount)
Fired by the CTA with the currently selected amount.
final
padding EdgeInsetsGeometry?
Overrides the body content padding. Defaults to EdgeInsets.all(BankTokens.space4).
final
profitRateLabel String
final
quickAmount Money?
Optional extra quick-pick amount (e.g. a personalised suggestion). Must share maxAmount's currency.
final
radius BorderRadius?
Overrides the card corner radius. Defaults to the theme cardRadius.
final
rateLabel String?
Overrides the APR / profit-rate label entirely.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadow List<BoxShadow>?
Overrides the card shadow. Defaults to BankTokens.shadowHero; pass const [] to flatten.
final
tenorTemplate String
{n} is substituted with maxMonths.
final
title String
final
titleStyle TextStyle?
Merged over the header title style (headlineSmall, onPrimary).
final
upToLabel String
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<BankPreapprovedLoanCard>
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