Simple chart that shows aggregated transactions per month

Widgets & Design

I have a Firestore collection: 'transactions' that contains:

  • amount (double)

  • status (string)

  • date (datetime)

Given: There are multiple transactions per months, some of them have status pending, some completed.

When: I open my app homepage

Then: I see a line chart, where I see last 6 months on the X axis and total amount (sum) of completed transactions

And: I am able to hover on the pointers for each month to see the value

I want to use a standard chart widget and achieve the following:

Dear community, can someone help with comprehensive tip on how to achieve this?

What have you tried so far?

I've checked multiple threads where a similar question was asked, but didn't find a solution.

I understand it's not possible to achieve this:

- using Custom Function (due to missing FireStore package access; no async; no return type type of Map

- using standard backend - collection reference (it just returns all data). Maximum I can filter something out and sort

- using custom action that allows async (but still doesn't allow return value of Map) is not clear (because custom actions happen on tap/click, and I need to display it straight away on the page load)

I also understand that if I'd have a backend API, I could achieve this, but for now I am trying to avoid backend for simplicity.

Did you check FlutterFlow's Documentation for this topic?
Yes
1
1 reply