Вы можете добавить кнопку на заднем крае плитки, используя свойство trailing
, равное ListTile
.
Например, здесь мы добавляем IconButton
:
Widget _ = ListView.builder(
itemBuilder: (BuildContext context, int index) {
return ListTile(
title: Text("Row $index"),
trailing: (data[position]['value'] == 0)
? IconButton(icon: Icon(Icons.alarm), onPressed: () {})
: null);
});