mardi 3 août 2021

Is it possible to delete a particular row of a datatable in flutter using onselectChanged? If so please give a sample code

I have tried to add row. I need the code for deleting the row. If there is any other method share sample code or logic.

void addRow() {
setState(() {
  rowList.add(DataRow(
    cells: <DataCell>[
      DataCell(Text('$rowCount')),
      DataCell(TextField(
          decoration: InputDecoration(
        border: OutlineInputBorder(),
        // hintText: 'field1',
      ))),


      DataCell(TextField(
          decoration: InputDecoration(
        border: OutlineInputBorder(),
        // hintText: 'field1',
      ))),
      DataCell(TextField(
          decoration: InputDecoration(
        border: OutlineInputBorder(),
        // hintText: 'field1',
      ))),
      DataCell(TextField(
          decoration: InputDecoration(
        border: OutlineInputBorder(),
        // hintText: 'field1',
      ))),
    ],
  ));
});

}




Aucun commentaire:

Enregistrer un commentaire