diff --git a/lib/ui/reports/reports_screen.dart b/lib/ui/reports/reports_screen.dart index b92852bc2..0ea3a7ff8 100644 --- a/lib/ui/reports/reports_screen.dart +++ b/lib/ui/reports/reports_screen.dart @@ -193,13 +193,10 @@ class ReportsScreen extends StatelessWidget { }), ], ), - FormCard( - child: ReportDataTable( - //key: ObjectKey(viewModel.reportResult.columns), - key: ValueKey( - '${viewModel.state.isSaving} ${reportsUIState.group}'), - viewModel: viewModel, - ), + ReportDataTable( + key: ValueKey( + '${viewModel.state.isSaving} ${reportsUIState.group}'), + viewModel: viewModel, ) ], ), @@ -274,27 +271,43 @@ class _ReportDataTableState extends State { ?.reportSettings[state.uiState.reportsUIState.report] ?? ReportSettingsEntity(); - return SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: DataTable( - sortColumnIndex: reportSettings.sortIndex, - sortAscending: reportSettings.sortAscending, - columns: reportResult.tableColumns( - context, - (index, ascending) => - widget.viewModel.onReportSorted(index, ascending)), - rows: [ - reportResult.tableFilters(context, - _textEditingControllers[state.uiState.reportsUIState.report], - (column, value) { - widget.viewModel.onReportFiltersChanged( - context, - state.uiState.reportsUIState.filters - .rebuild((b) => b..addAll({column: value}))); - }), - ...reportResult.tableRows(context), - ], - ), + return Column( + children: [ + FormCard( + child: DataTable( + columns: [ + DataColumn( + label: Text(AppLocalization.of(context).totals), + ) + ], + rows: [], + ), + ), + FormCard( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: DataTable( + sortColumnIndex: reportSettings.sortIndex, + sortAscending: reportSettings.sortAscending, + columns: reportResult.tableColumns( + context, + (index, ascending) => + widget.viewModel.onReportSorted(index, ascending)), + rows: [ + reportResult.tableFilters(context, + _textEditingControllers[state.uiState.reportsUIState.report], + (column, value) { + widget.viewModel.onReportFiltersChanged( + context, + state.uiState.reportsUIState.filters + .rebuild((b) => b..addAll({column: value}))); + }), + ...reportResult.tableRows(context), + ], + ), + ), + ), + ], ); } } diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index 94c9b8c17..79453bf62 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -14,6 +14,7 @@ abstract class LocaleCodeAware { mixin LocalizationsProvider on LocaleCodeAware { static final Map> _localizedValues = { 'en': { + 'totals': 'Totals', 'blank': 'Blank', 'day': 'Day', 'month': 'Month', @@ -14600,6 +14601,8 @@ mixin LocalizationsProvider on LocaleCodeAware { String get total => _localizedValues[localeCode]['total']; + String get totals => _localizedValues[localeCode]['totals']; + String get percent => _localizedValues[localeCode]['percent']; String get edit => _localizedValues[localeCode]['edit'];