Best Practice Question: Passing Data to Components in FlutterFlow

Actions & Logic

Hi everyone 👋

I’m working on a ListView widget in FlutterFlow that uses a backend query (GET API call to Xano) to fetch all records from my database. Inside this ListView, I’m using a component widget that gets generated dynamically from the API response.

Now, here’s my dilemma — I’m not sure which of these two setups is the better best practice:

Approach 1

  • Create a component parameter of type JSON

  • Pass the full JSON object into the component

  • Populate each variable inside the component directly from that JSON

Approach 2

  • Create a component parameter of type Integer (ID)

  • Inside the component, run another API call to fetch the single record from Xano based on the ID

What I’ve noticed is that Approach 1 feels slightly faster, with Approach 2, it seems the page loads first and then each component fetches its own data, which creates a slight delay (though I’m not 100% sure).



From your experience, which approach is better in terms of Performance

And if there’s an even better third approach that I haven’t considered, I’d love to hear your recommendations!

Thanks in advance for your insights 🚀

What have you tried so far?

N/A

Did you check FlutterFlow's Documentation for this topic?
No
1
8 replies