finance_calculators_core library
The calculation core of finance_calculators: no widgets, no dart:ui.
Import this library when you only need the numbers.
Classes
- AmortizationRow
- One instalment of a loan schedule.
- BreakdownRow
- One period (a month or a year) of a calculation.
- CagrCalculator
-
Compound annual growth rate:
CAGR = (end / start)^(1/years) - 1. Excel equivalent:=RRI(years, start, end). - CagrResult
- Result of CagrCalculator.calculate.
- CalculatorResult
- Common shape of every calculator result: three headline totals and a month-by-month plus year-by-year breakdown, all immutable.
- EmiCalculator
- Loan EMI and amortization schedule.
- EmiResult
- Result of EmiCalculator.calculate.
- FdCalculator
- Fixed deposit (cumulative): a lumpsum with a bank compounding convention.
- GoalPlanner
- Works out the SIP or lumpsum needed to reach a target.
- GoalPlanResult
- Result of GoalPlanner.calculate.
- InflationCalculator
-
Effect of inflation:
future = amount * (1 + inflation)^yearsand the inflation-adjusted (real) valueamount / (1 + inflation)^years. - InflationResult
- Result of InflationCalculator.calculate.
- LumpsumCalculator
- One-time investment.
- LumpsumResult
- Result of LumpsumCalculator.calculate and FdCalculator.calculate.
- Prepayment
- A one-time extra payment towards the principal.
- RdCalculator
- Recurring deposit.
- RdResult
- Result of RdCalculator.calculate.
- RetirementCalculator
- Retirement corpus and the SIP that builds it.
- RetirementResult
- Result of RetirementCalculator.calculate.
- SipCalculator
- Systematic Investment Plan, with an optional yearly step-up.
- SipResult
- Result of SipCalculator.calculate.
- StepUp
- How a SIP instalment grows once a year.
- SwpCalculator
- Systematic Withdrawal Plan.
- SwpResult
- Result of SwpCalculator.calculate.
- Tenure
- Length of an investment or loan, stored as whole months.
Enums
- Compounding
- How often interest is added to the balance.
- PaymentTiming
- Whether a periodic payment happens at the start or the end of the period.
- RateConvention
- How an annual rate becomes a monthly growth rate.
Constants
- maxRatePercent → const double
- Largest annual rate accepted, in percent.
- maxTenureMonths → const int
- Longest tenure accepted by the calculators (100 years).
Functions
-
aggregateYearly(
List< BreakdownRow> monthly) → List<BreakdownRow> - Groups monthly rows into years (the last year may be partial).
Exceptions / Errors
- InvalidInputException
- Thrown when a calculator receives an input it cannot work with.