Skip to content

Instantly share code, notes, and snippets.

@Abdulsametileri
Created February 20, 2021 08:42
Show Gist options
  • Save Abdulsametileri/1cc1a7bf67ebda97848e4091687d7652 to your computer and use it in GitHub Desktop.
Save Abdulsametileri/1cc1a7bf67ebda97848e4091687d7652 to your computer and use it in GitHub Desktop.
SizedBox _buildDataTable() {
return SizedBox(
width: double.infinity,
child: Observer(builder: (_) {
return DataTable(
showBottomBorder: true,
columns: [
DataColumn(label: Text('Bill Date')),
DataColumn(label: Text('Amount')),
],
rows: _vm.invoices
.map<DataRow>(
(ExInvoiceModel invoice) => DataRow(
selected: invoice.isSelected,
onSelectChanged: (bool isSelected) {
invoice.isSelected = !invoice.isSelected;
},
cells: [
DataCell(Text(invoice.date)),
DataCell(Text('${invoice.amount} \$')),
],
),
)
.toList(),
);
}),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment