Setting an App/Page State of a Custom Data Type within an Action Chain

Database & APIs

I have an app that looks for local businesses near the user. Right now I use a loop within an action to search for businesses and based on the number of responses from the API, tries again. This works fine but I'm having a heck of a time sorting that list by the distance field in the API response.

I believe converting the API response data to a custom data type may give me that ability (?), but I can't seem to get the API response to write a page or app state of the custom data type within the action.

This works but doesn't cast the response to a more manipulable data type:

This does not work: (Nor does anything else I've tried!)

Any thoughts on how I can get this working or what I'm doing wrong here? All I see is "null" when testing.

What have you tried so far?
  • Update a page state casting the API response into the data type

  • Update an app state casting the API response into the data type

  • Using Add to List and specifying the fields I need when creating the App State.

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