mercredi 28 août 2019

How to add List view with dynamic selection checkbox inside expansion tile in flutter

I am facing problem to add listview with checkbox inside multiple ExpansionTile. Also, a checkbox has to be dynamically selection.

In this images I've created one expansion tile and inside I had put list tile with checkbox but when I am adding multiple expansion tile all are either selected or not selected based on value but i want to select user wanted value it means it should be dynamically

body: ExpansionTile(
      title: Text("Expansion"),
      children: _listViewData
          .map((data) => CheckboxListTile(
                title: Text(data),
                value: _isChecked,
                onChanged: (val) {
                  setState(() {
                    _isChecked = val;
                  });
                },
              ))
          .toList(),
    ));

Here is the image




Aucun commentaire:

Enregistrer un commentaire