RIP-Comm / sossoldi

"Sossoldi" is a wealth management / personal finance / Net Worth tracking app, made with Flutter.
MIT License
266 stars 74 forks source link

high level classes to do some math #41

Closed mikev-cw closed 1 year ago

mikev-cw commented 1 year ago

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

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.

napitek commented 1 year ago

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.

mikev-cw commented 1 year ago

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

theperu commented 1 year ago

This was covered with the implementation of Riverpod