This commit is contained in:
Hillel Coren 2020-02-14 11:43:17 +02:00
parent f1ffe34573
commit 08df4b4b6c
2 changed files with 6 additions and 6 deletions

View File

@ -134,10 +134,7 @@ class ReportsScreen extends StatelessWidget {
AppDropdownButton<String>(
labelText: localization.subgroup,
value: reportsUIState.subgroup,
blankValue: '',
showBlank: true,
onChanged: (dynamic value) {
print('Subgroup: onChanged - $value');
viewModel.onSettingsChanged(subgroup: value);
},
items: [
@ -249,7 +246,6 @@ class _ReportDataTableState extends State<ReportDataTable> {
}
void _onChanged(String column, String value) {
print('## On changed - column: $column - $value');
final state = widget.viewModel.state;
widget.viewModel.onReportFiltersChanged(
context,
@ -622,7 +618,10 @@ class ReportResult {
if (column == groupBy) {
if (getReportColumnType(column) == ReportColumnType.dateTime) {
group = formatDate(group, context);
} else if (group.isEmpty) {
group = AppLocalization.of(context).blank;
}
value = group + ' (' + values['count'].floor().toString() + ')';
} else if (getReportColumnType(column) == ReportColumnType.number) {
value = formatNumber(values[column], context);
@ -631,8 +630,6 @@ class ReportResult {
}
rows.add(DataRow(cells: cells));
});
print('## TOTALS: $totals');
}
return rows;

View File

@ -14,6 +14,7 @@ abstract class LocaleCodeAware {
mixin LocalizationsProvider on LocaleCodeAware {
static final Map<String, Map<String, String>> _localizedValues = {
'en': {
'blank': 'Blank',
'day': 'Day',
'month': 'Month',
'year': 'Year',
@ -16085,6 +16086,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
String get year => _localizedValues[localeCode]['year'];
String get blank => _localizedValues[localeCode]['blank'];
String lookup(String key) {
final lookupKey = toSnakeCase(key);
return _localizedValues[localeCode][lookupKey] ??