I am using this package for flutter datables but the problem with this pakage is i am not able to add widget in this datatables row...
Is anyone has any idea how can I do that ? I tried other packages but this is really nice. but this has that problem...
I want to add edit,print,view button in the row but Not able to add...
code
List<Map<String, dynamic>> data = [
{
"_id": 1,
"invoice_no": "101101",
"counter": "Satara",
"customer": "Swapnil Mane",
"customer_type": "Mart",
"date": "20-10-2022",
"qty": "10002",
"grand_total": 2000,
"status": "Done"
},
];
WebDataTable(
initialFirstRowIndex: 0,
rowsPerPage: 12,
source: WebDataTableSource(
sortAscending: true,
columns: [
WebDataColumn(
sortable: true,
name: '_id',
label: const Text('Sr. No'),
dataCell: (value) => DataCell(Text('$value')),
),
WebDataColumn(
name: 'invoice_no',
label: const Text('Invoice No'),
dataCell: (value) => DataCell(Text('$value')),
),
WebDataColumn(
name: 'counter',
label: const Text('Counter Name'),
dataCell: (value) => DataCell(Text('$value')),
),
WebDataColumn(
name: 'customer',
label: const Text('Customer Name'),
dataCell: (value) => DataCell(Text('$value')),
),
WebDataColumn(
name: 'customer_type',
label: const Text('Customer Type'),
dataCell: (value) => DataCell(Text('$value')),
),
WebDataColumn(
name: 'date',
label: const Text('Date & Time'),
dataCell: (value) => DataCell(Text('$value')),
),
WebDataColumn(
name: 'qty',
label: const Text('Qty'),
dataCell: (value) => DataCell(Text('$value')),
sortable: true,
),
WebDataColumn(
name: 'grand_total',
label: const Text('Grand Total'),
dataCell: (value) => DataCell(Text('$value')),
sortable: true,
),
],
rows: data),
header: Text(""),
You can simply add a widget to this package in each row. and this example used is in the same package with some changes to accept widget.
here is the example code
main.dart
sample_data.dart