BankLoanCalculatorCard class
Amount / tenor sliders with a live repayment preview: the entry
point that front-ends BankRepaymentScheduleView and
BankInstallmentPlanSelector.
The payment math follows financingModel. When it is null the
model tracks islamicFinanceMode: conventional amortization
normally, Murabaha cost-plus (flat profit fixed at contract time)
when Islamic mode is on, so the label and the arithmetic always
agree. The rate line honours islamicFinanceMode (profit rate
instead of APR) unless rateLabel overrides it. Totals render via
BankSummaryStack.
BankLoanCalculatorCard(
minAmount: Money.fromDouble(5000, 'SAR'),
maxAmount: Money.fromDouble(250000, 'SAR'),
minMonths: 6,
maxMonths: 60,
annualRate: 0.049,
onChanged: (amount, months) => quote(amount, months),
onContinue: _startApplication,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- BankLoanCalculatorCard
Constructors
-
BankLoanCalculatorCard({required Money minAmount, required Money maxAmount, required int minMonths, required int maxMonths, required double annualRate, required void onChanged(Money amount, int months), Key? key, Money? initialAmount, int? initialMonths, String? rateLabel, Widget? disclosureSlot, VoidCallback? onContinue, String continueLabel = 'Continue', String amountLabel = 'Loan amount', String tenorTemplate = '{n} months', String monthlyLabel = 'Monthly payment', String totalRepayableLabel = 'Total repayable', String costOfCreditLabel = 'Cost of credit', String aprLabel = 'APR', String profitRateLabel = 'Profit rate', BankFinancingModel? financingModel, String profitAmountLabel = 'Total profit', EdgeInsetsGeometry? padding, BorderRadius? radius, Color? backgroundColor, Color? borderColor, List<
BoxShadow> ? shadow, Color? accentColor, TextStyle? labelStyle, TextStyle? amountStyle, TextStyle? monthlyStyle, Duration? animationDuration, Curve? animationCurve}) -
const
Properties
- accentColor → Color?
-
Accent for the sliders, the monthly figure, and the continue
button. Defaults to the theme primary.
final
- amountLabel → String
-
final
- amountStyle → TextStyle?
-
Merged over the selected-amount numeral style (numeralLarge).
final
- animationCurve → Curve?
-
Curve of the monthly figure cross-fade. Defaults to linear.
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.049for 4.9 %.final - aprLabel → String
-
final
- backgroundColor → Color?
-
Overrides the card fill color. Defaults to the theme surface.
final
- borderColor → Color?
-
Overrides the card border color. Defaults to the theme outline.
final
- continueLabel → String
-
final
- costOfCreditLabel → String
-
final
- disclosureSlot → Widget?
-
Slot for regulatory representative-example text.
final
- financingModel → BankFinancingModel?
-
Payment arithmetic. Null tracks
islamicFinanceMode: amortizing conventionally, BankFinancingModel.murabaha in Islamic mode.final - hashCode → int
-
The hash code for this object.
no setterinherited
- initialAmount → Money?
-
final
- initialMonths → int?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labelStyle → TextStyle?
-
Merged over the small caption styles (amountLabel, tenor line,
and monthlyLabel).
final
- maxAmount → Money
-
final
- maxMonths → int
-
final
- minAmount → Money
-
final
- minMonths → int
-
final
- monthlyLabel → String
-
final
- monthlyStyle → TextStyle?
-
Merged over the monthly payment hero style (numeralHero, accent).
final
- onChanged → void Function(Money amount, int months)
-
Fired on every slider commit with the selected amount and tenor.
final
- onContinue → VoidCallback?
-
Renders a full-width continue button when set.
final
- padding → EdgeInsetsGeometry?
-
Overrides the card content padding. Defaults to
EdgeInsets.all(BankTokens.space4).final - profitAmountLabel → String
-
Replaces costOfCreditLabel under BankFinancingModel.murabaha.
final
- profitRateLabel → String
-
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.shadowCard;
pass
const []to flatten.final - tenorTemplate → String
-
{n}is substituted with the tenor.final - totalRepayableLabel → String
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< BankLoanCalculatorCard> -
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