lundi 24 décembre 2018

Flutter Checkbox Animation Not Showing

So I have a ListView of ListTiles and every tile has a checkbox in it. I can change the state of the checkboxes just fine but the proper animation does not show. What am I missing here? Thanks!

Widget _buildListTile(BuildContext context, Task item) {
return Dismissible(
  // Show a red background as the item is swiped away
  background: Container(color: Colors.red),
  key: Key(item.hashCode.toString()),
  onDismissed: (direction) {
    setState(() {
      tasks.remove(item);
    });
  },
  child: ListTile(
    leading: Checkbox(
      value: item.checked,
      onChanged: (bool newValue) {
        setState(() {
          item.checked = newValue;
        });
      },
      activeColor: Colors.blue,
    ),
    title: InkWell(
        onTap: () {
          editTask(item);
        },
        child: Text(
          item.task,
          style: TextStyle(fontSize: 18),
        )),
    contentPadding: EdgeInsets.all(8),
    //trailing: Icon(Icons.drag_handle),
  ),
);
}




Aucun commentaire:

Enregistrer un commentaire