Flutter DataTable - Tap on row

前端 未结 4 1520
小鲜肉
小鲜肉 2020-12-16 06:25

I am using Flutter DataTables to display list of items in cart. Now I want to edit the quantity of any selected row. Is there a way to get the information of the row user ha

4条回答
  •  孤城傲影
    2020-12-16 07:18

    you can use onSelectChanged property from DataRow.

    rows: items
        .map(
            (itemRow) => DataRow(
                onSelectChanged: (bool selected) {
                    if (selected) {
                        log.add('row-selected: ${itemRow.index}');
                    }
                },
                cells: [
                    // ..
                ],
            ),
    

提交回复
热议问题