RIP-Comm / sossoldi

"Sossoldi" is a wealth management / personal finance / Net Worth tracking app, made with Flutter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

high level classes to do some math

mikev-cw opened this issue · comments

We need something like one or a set of (abstract?) classes to compute data like:

  • monthly budget (sum of all monthly transactions, to split by categories)
  • accounts balances (sum of all transactions ever referring to that account + starting balance)
  • net worth (sum of all transactions ever of all accounts + starting balance of all accounts + investments)
  • ecc...

We want something to call after a trigger, that perform the calc, and store it in the DB. Possibly should call linked data to re-calc them.

For instance: When the user adds a transaction for the previous month (trigger), we need to re-calc all sums of that month, maybe that year, maybe the NW, and store that data SQLite for quickly showing in the UI.

To be able to do such a thing, would require a different design pattern.
Using class abstraction is a start but not enough.
When you scale, initState() starts to get inconvenient and refresh/rebuild the whole screen every time a value/state changes.
Working for a while with Flutter, I can tell you that the first thing to do would be to think about the App integrating a State Manager.
https://bloclibrary.dev/# seems like a pretty good solution to me, especially thinking that it will need to scale easily, by the time the App is usable.

After that,I would also start thinking about background tasks, not dependent on user actions, on separate threads, which in Flutter are called Isolates.

Yeah we spoke about state managers (specifically about bloc) on Discord. Actually I also think we'll integrating it.

This was covered with the implementation of Riverpod