Scrolling a horizontal Row (Generate Dynamic Children) to a specific item's position

Widgets & Design

I have a horizontal scrollable Row with "Generate Dynamic Children" enabled, bound to an App State List<String> variable (10 category names). Each generated chip highlights based on a Component Parameter (currentCategory) matching its own value in the list, and tapping a chip navigates to that category's page.

What I'm trying to do: When the component loads, I want the Row to automatically scroll so the currently-active chip (the one matching currentCategory) is visible/centered, instead of always starting at the beginning of the scroll.

My question: Is there a supported way (native action, ListView-specific feature, or another Custom Action workaround) to scroll a Generate-Dynamic-Children widget to a specific index or item, rather than only Beginning/End? If ListView supports this and Row doesn't, please confirm that so I know converting is worth doing.

What have you tried so far?
  • Added a Scroll Controller to the Row and used the built-in "Scroll To" action on "On Initialization" โ€” but this only offers "Beginning" or "End" as options, no way to scroll to a specific index or pixel offset.

  • Considered writing a Custom Action to directly animate a ScrollController to a calculated offset, but "Scroll Controller" isn't available as an argument Type when defining Custom Action parameters, so I can't pass the controller into custom code.

  • Considered converting the Row to a ListView instead, hoping it might expose a "Scroll to Index" action, but haven't rebuilt it yet since I'm not sure that's actually supported either.

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