Pass the position of a ListView Element’s CheckBox to onChanged callback in Flutter

I wrote the peace of code below: int numberLines = 50; List<bool> checkBoxValues = []; int i = 0; while(i < numberLines) { checkBoxValues.add(false); i++; } void medCheckedChanged(bool value) => setState(() => checkBoxValues[position] = value); ListView.builder ( itemCount: numberLines, itemBuilder: (context, position) { return Column ( children: <Widget> [ Container ( height: resLayout.getScreenHeightPercentage(context, 6), width:…

Details