How to display dynamic cell values in a generated DataTable using dynamic column index and field keys?

Widgets & Design

I'm building a reusable component using FlutterFlow's native DataTable widget. I already successfully set:

  • rawData as a List<JSON> via parameter

  • Dynamically generated fieldKeys using a custom function (extractKeysFromFirstRow)

  • Dynamic column count based on fieldKeys

  • Dynamic headers using fieldKeys[DataTable Dynamic Column Index]

My challenge is:

I want each DataTableCell to show the value that corresponds to the row and current column

What have you tried so far?
  • Tried using JSON Path: [fieldKeys[DataTable Dynamic Column Index]] β†’ not allowed

  • Used Index in List β†’ DataTable Dynamic Column Index

We're trying to avoid unnecessary custom functions if FlutterFlow has a built-in way to support this pattern.

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