BankSavingsProjectionCard constructor

const BankSavingsProjectionCard({
  1. required String currencyCode,
  2. required double annualRate,
  3. Key? key,
  4. double initialAmount = 1000,
  5. double minAmount = 100,
  6. double maxAmount = 50000,
  7. double amountStep = 100,
  8. int minMonths = 1,
  9. int maxMonths = 36,
  10. int initialMonths = 12,
  11. void onApply(
    1. Money deposit,
    2. int months
    )?,
  12. String title = 'Savings projection',
  13. String amountLabel = 'Deposit amount',
  14. String monthsTemplate = '{n} months',
  15. String depositLabel = 'Deposit',
  16. String rateLabel = 'Interest rate (AER)',
  17. String profitRateLabel = 'Expected profit rate',
  18. String earningsLabel = 'Interest earned',
  19. String profitEarningsLabel = 'Expected profit',
  20. String totalLabel = 'Total at maturity',
  21. String applyLabel = 'Start saving',
  22. EdgeInsetsGeometry? padding,
  23. BorderRadius? radius,
  24. Color? backgroundColor,
  25. Color? accentColor,
  26. List<BoxShadow>? shadow,
  27. TextStyle? titleStyle,
  28. TextStyle? amountStyle,
})

Creates a savings projection calculator card.

Implementation

const BankSavingsProjectionCard({
  required this.currencyCode,
  required this.annualRate,
  super.key,
  this.initialAmount = 1000,
  this.minAmount = 100,
  this.maxAmount = 50000,
  this.amountStep = 100,
  this.minMonths = 1,
  this.maxMonths = 36,
  this.initialMonths = 12,
  this.onApply,
  this.title = 'Savings projection',
  this.amountLabel = 'Deposit amount',
  this.monthsTemplate = '{n} months',
  this.depositLabel = 'Deposit',
  this.rateLabel = 'Interest rate (AER)',
  this.profitRateLabel = 'Expected profit rate',
  this.earningsLabel = 'Interest earned',
  this.profitEarningsLabel = 'Expected profit',
  this.totalLabel = 'Total at maturity',
  this.applyLabel = 'Start saving',
  this.padding,
  this.radius,
  this.backgroundColor,
  this.accentColor,
  this.shadow,
  this.titleStyle,
  this.amountStyle,
})  : assert(annualRate >= 0, 'annualRate must not be negative.'),
      assert(minAmount > 0, 'minAmount must be positive.'),
      assert(minAmount < maxAmount, 'minAmount must be below maxAmount.'),
      assert(amountStep > 0, 'amountStep must be positive.'),
      assert(minMonths >= 1, 'minMonths must be at least 1.'),
      assert(
        minMonths <= maxMonths,
        'minMonths must not exceed maxMonths.',
      );