1

Is it possible to instruct a ListView builder to go to a certain index number or to begin building with that number at the top of the screen?

Essentially, the builder is making complicated sections and I want to be able to use an index/TOC to open the list at a certain index number and then be able to scroll both up and down the list.

Chris Hill
  • 13
  • 2
  • I think it is almost the same strategy suggested in this question. https://stackoverflow.com/questions/43485529/programmatically-scrolling-to-the-end-of-a-listview However, for your case it's just a matter of make the 0.0 dynamic – Victor Hugo Montes Jun 05 '18 at 17:27
  • I have proposed an answer on that question and that is exactly your problem. The other question that is proposed as a possible duplicate is actually a duplicate of the question I linked, which is way older. – creativecreatorormaybenot Jun 05 '18 at 19:13
  • Thanks for pointing those out. Unfortunately, most of the answers work around the primary issue by needing to calculate the position of the desired element. My list is unfortunately complex enough that individual items could have a height of 10 or of 100 based on the length of the contained text. Really this is dependent on https://github.com/flutter/flutter/issues/12319 being resolved. Until then I may have to try to get scrollable.ensureVisible working. – Chris Hill Jun 07 '18 at 08:22

0 Answers0