I want to create multi input in list view with dynamic total item count . I use list of textcontroller but when I input a data all controller show with same value.
this my controller :
int totalItem = 15;
List<TextEditingController> _color = List.filled(15, TextEditingController());
List<TextEditingController> _brand = List.filled(15, TextEditingController());
implement at textfield :
Padding(
padding: const EdgeInsets.only(bottom: 10, left: 20, right: 20),
child: TextFormField(
controller: _color[index],
decoration: InputDecoration(
hintText: "Color",
labelText: "Color",
),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 10, left: 20, right: 20),
child: TextFormField(
controller: _brand[index],
decoration: InputDecoration(
hintText: "Brand",
labelText: "Brand",
),
),
),
When run the app text controller show with same value. Please help me to solve this problem?
Complete code : https://github.com/gunartha/listview_with_multi_input
Thank you.
