Afoke Akpomiemie
ย ยทย Freelancer

API call convert to Datatype showing empty list on UI

Database & APIs

Please I need your assistance for an issue I have been battliing for a week. Which is saving list of items in app state through API call. For instance, I have list of products saved in supabase, so when a new store owner signs up to use the point of sale app I am creating, I want all the list to download and be stored in app state. So that they can create a sale offline, which would be synced to the internet automatically when internet is restored. But I have been having issues getting the list from my API call save on APP state, so the products can be available to create the sale offline.

What have you tried so far?

The approach i used was creating a data type-an exact replica of my supabase schema, so when i do the API call, I parse the list to datatype and set to list at the point of the API call. However after binding that data to UI, on test mode, it shows an empty list. What am I doing wrong? Is there a better way? Or should I use a custom Action to convert from JSON file.

Another approach I tried was to do an action query of page load for API call, then tried to update APP state from the action output. At tye point of updating app state, I used Add to list, it didnt give me the right option, then tried set apl state, still didnt give me the right option.

Please any sugestion on what I can do?

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