How to get the index/key of the selected item in the list Flutter?

Posted by Editorial Staff | Updated on

Want to get the index/key of the selected item in the list Flutter? You would want to build your list of ListTiles within a ListView, and use List.generate constructor to get the index of the children here is a simple example:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers