Reports
This commit is contained in:
parent
547b687b43
commit
6cfbf3b24a
|
|
@ -53,7 +53,8 @@ class ReportsScreen extends StatelessWidget {
|
|||
? null
|
||||
: IconButton(
|
||||
icon: Icon(Icons.menu),
|
||||
onPressed: () => store
|
||||
onPressed: () =>
|
||||
store
|
||||
.dispatch(UserSettingsChanged(sidebar: AppSidebar.menu)),
|
||||
),
|
||||
title: Row(
|
||||
|
|
@ -93,7 +94,8 @@ class ReportsScreen extends StatelessWidget {
|
|||
kReportTaxRate,
|
||||
kReportQuote,
|
||||
]
|
||||
.map((report) => DropdownMenuItem(
|
||||
.map((report) =>
|
||||
DropdownMenuItem(
|
||||
value: report,
|
||||
child: Text(localization.lookup(report)),
|
||||
))
|
||||
|
|
@ -233,7 +235,9 @@ class _ReportDataTableState extends State<ReportDataTable> {
|
|||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
DataTable(
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: DataTable(
|
||||
columns: reportResult.tableColumns(
|
||||
context,
|
||||
(index, ascending) =>
|
||||
|
|
@ -250,6 +254,7 @@ class _ReportDataTableState extends State<ReportDataTable> {
|
|||
...reportResult.tableRows(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
@ -266,13 +271,14 @@ class ReportResult {
|
|||
final List<String> allColumns;
|
||||
final List<List<ReportElement>> data;
|
||||
|
||||
List<DataColumn> tableColumns(
|
||||
BuildContext context, Function(int, bool) onSortCallback) {
|
||||
List<DataColumn> tableColumns(BuildContext context,
|
||||
Function(int, bool) onSortCallback) {
|
||||
final localization = AppLocalization.of(context);
|
||||
|
||||
return [
|
||||
for (String column in columns)
|
||||
DataColumn(
|
||||
tooltip: localization.lookup(column),
|
||||
label: Text(
|
||||
localization.lookup(column),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
|
@ -282,8 +288,7 @@ class ReportResult {
|
|||
];
|
||||
}
|
||||
|
||||
DataRow tableFilters(
|
||||
BuildContext context,
|
||||
DataRow tableFilters(BuildContext context,
|
||||
Map<String, TextEditingController> textEditingControllers,
|
||||
Function(String, String) onFilterChanged) {
|
||||
return DataRow(cells: [
|
||||
|
|
@ -301,7 +306,10 @@ class ReportResult {
|
|||
return data
|
||||
.where((row) =>
|
||||
row[index].sortString().toLowerCase().contains(filter) &&
|
||||
row[index].sortString().trim().isNotEmpty)
|
||||
row[index]
|
||||
.sortString()
|
||||
.trim()
|
||||
.isNotEmpty)
|
||||
.map((row) => row[index].sortString())
|
||||
.toSet()
|
||||
.toList();
|
||||
|
|
@ -345,7 +353,8 @@ class ReportResult {
|
|||
DataRow(
|
||||
cells: row
|
||||
.map(
|
||||
(row) => DataCell(
|
||||
(row) =>
|
||||
DataCell(
|
||||
row.renderWidget(context),
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue