Hi all,
Context:
I am creating a workout fitness tracker to learn and practice Flutterflow. I have a widget that displays the current exercise being performed by the user (e.g. bench press), allows them to input their weight and reps, and also displays the weight and reps of their previous performance. The widget also summarises the overall stats (volume, max weight, best set) of the current workout and displays them at the footer in comparison to the stats of the previous workout.
The widget automatically writes updates to Supabase on TextField changes, and on initialization fetches the data of the previous workout stored as a list of rows in a component state variable.
Problem:
I want to create a custom function that handles a list of Supabase rows as an argument and manipulates the data as required.
I want to do this to avoid making multiple repetitive data requests to Supabase and to keep the compute on the local user device. I want to fetch the rows once, store them in the component state, and pass them to each custom function which can return the relevant data required ( sum(column A), product(column B, column C), max(column D), etc. ).
However, I cannot get my function to work and I am unclear as to how to properly work with a Supabase Row data type within custom code.
I am under the impression that a Supabase row is of datatype Map, but the code editor throws errors using the relevant syntax and the Test Function returns 'Error running function. Please contact flutter support'.