Refresh tables
This commit is contained in:
parent
23d7a63c6d
commit
2e68dcae1e
|
|
@ -132,38 +132,47 @@ class _EntityListState extends State<EntityList> {
|
||||||
)),
|
)),
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
return SingleChildScrollView(
|
return Stack(
|
||||||
child: Padding(
|
alignment: Alignment.topCenter,
|
||||||
padding: const EdgeInsets.all(12),
|
children: <Widget>[
|
||||||
child: PaginatedDataTable(
|
if (state.isLoading)
|
||||||
onSelectAll: (value) {
|
LinearProgressIndicator(),
|
||||||
final invoices = entityList
|
SingleChildScrollView(
|
||||||
.map((String entityId) => entityMap[entityId])
|
child: Padding(
|
||||||
.where(
|
padding: const EdgeInsets.all(12),
|
||||||
(invoice) => value != listUIState.isSelected(invoice.id))
|
child: PaginatedDataTable(
|
||||||
.toList();
|
onSelectAll: (value) {
|
||||||
handleEntitiesActions(
|
final invoices = entityList
|
||||||
context, invoices, EntityAction.toggleMultiselect);
|
.map((String entityId) => entityMap[entityId])
|
||||||
},
|
.where((invoice) =>
|
||||||
columns: [
|
value != listUIState.isSelected(invoice.id))
|
||||||
if (!listUIState.isInMultiselect()) DataColumn(label: SizedBox()),
|
.toList();
|
||||||
...widget.tableColumns.map((field) => DataColumn(
|
handleEntitiesActions(
|
||||||
label: Text(AppLocalization.of(context).lookup(field)),
|
context, invoices, EntityAction.toggleMultiselect);
|
||||||
numeric: EntityPresenter.isFieldNumeric(field),
|
},
|
||||||
onSort: (int columnIndex, bool ascending) =>
|
columns: [
|
||||||
widget.onSortColumn(field))),
|
if (!listUIState.isInMultiselect())
|
||||||
],
|
DataColumn(label: SizedBox()),
|
||||||
source: dataTableSource,
|
...widget.tableColumns.map((field) => DataColumn(
|
||||||
header: DatatableHeader(
|
label: Text(AppLocalization.of(context).lookup(field)),
|
||||||
entityType: widget.entityType,
|
numeric: EntityPresenter.isFieldNumeric(field),
|
||||||
onClearPressed: widget.onClearEntityFilterPressed,
|
onSort: (int columnIndex, bool ascending) =>
|
||||||
onRefreshPressed: () => widget.onRefreshed(context),
|
widget.onSortColumn(field))),
|
||||||
),
|
],
|
||||||
sortColumnIndex:
|
source: dataTableSource,
|
||||||
widget.tableColumns.indexOf(listUIState.sortField) + 1,
|
header: DatatableHeader(
|
||||||
sortAscending: listUIState.sortAscending,
|
entityType: widget.entityType,
|
||||||
),
|
onClearPressed: widget.onClearEntityFilterPressed,
|
||||||
));
|
onRefreshPressed: () => widget.onRefreshed(context),
|
||||||
|
),
|
||||||
|
sortColumnIndex:
|
||||||
|
widget.tableColumns.indexOf(listUIState.sortField) + 1,
|
||||||
|
sortAscending: listUIState.sortAscending,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue