Flutter: How to implement a list returned by Future and show the subtotal after refresh?

83 views Asked by At

What's the best way to implement the following scenario using the stacked package? I have a list of items with price. This list is returned from a future. I also have a datepicker. By changing the date, the list is refreshed with new data. Every time the list gets refreshed, I want to show the subtotal value in the app bar of the page. I tried to wrap the page in the FutureViewModel class and it works to refresh the list. But I am not sure how to update the subtotal. Should subtotal have a separate modelview? I think the subtotal should be calculated where the list of items exists. I am not sure how to implement this.

0

There are 0 answers