Reports
This commit is contained in:
parent
f1ffe34573
commit
08df4b4b6c
|
|
@ -134,10 +134,7 @@ class ReportsScreen extends StatelessWidget {
|
||||||
AppDropdownButton<String>(
|
AppDropdownButton<String>(
|
||||||
labelText: localization.subgroup,
|
labelText: localization.subgroup,
|
||||||
value: reportsUIState.subgroup,
|
value: reportsUIState.subgroup,
|
||||||
blankValue: '',
|
|
||||||
showBlank: true,
|
|
||||||
onChanged: (dynamic value) {
|
onChanged: (dynamic value) {
|
||||||
print('Subgroup: onChanged - $value');
|
|
||||||
viewModel.onSettingsChanged(subgroup: value);
|
viewModel.onSettingsChanged(subgroup: value);
|
||||||
},
|
},
|
||||||
items: [
|
items: [
|
||||||
|
|
@ -249,7 +246,6 @@ class _ReportDataTableState extends State<ReportDataTable> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onChanged(String column, String value) {
|
void _onChanged(String column, String value) {
|
||||||
print('## On changed - column: $column - $value');
|
|
||||||
final state = widget.viewModel.state;
|
final state = widget.viewModel.state;
|
||||||
widget.viewModel.onReportFiltersChanged(
|
widget.viewModel.onReportFiltersChanged(
|
||||||
context,
|
context,
|
||||||
|
|
@ -622,7 +618,10 @@ class ReportResult {
|
||||||
if (column == groupBy) {
|
if (column == groupBy) {
|
||||||
if (getReportColumnType(column) == ReportColumnType.dateTime) {
|
if (getReportColumnType(column) == ReportColumnType.dateTime) {
|
||||||
group = formatDate(group, context);
|
group = formatDate(group, context);
|
||||||
|
} else if (group.isEmpty) {
|
||||||
|
group = AppLocalization.of(context).blank;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = group + ' (' + values['count'].floor().toString() + ')';
|
value = group + ' (' + values['count'].floor().toString() + ')';
|
||||||
} else if (getReportColumnType(column) == ReportColumnType.number) {
|
} else if (getReportColumnType(column) == ReportColumnType.number) {
|
||||||
value = formatNumber(values[column], context);
|
value = formatNumber(values[column], context);
|
||||||
|
|
@ -631,8 +630,6 @@ class ReportResult {
|
||||||
}
|
}
|
||||||
rows.add(DataRow(cells: cells));
|
rows.add(DataRow(cells: cells));
|
||||||
});
|
});
|
||||||
|
|
||||||
print('## TOTALS: $totals');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rows;
|
return rows;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ abstract class LocaleCodeAware {
|
||||||
mixin LocalizationsProvider on LocaleCodeAware {
|
mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
|
'blank': 'Blank',
|
||||||
'day': 'Day',
|
'day': 'Day',
|
||||||
'month': 'Month',
|
'month': 'Month',
|
||||||
'year': 'Year',
|
'year': 'Year',
|
||||||
|
|
@ -16085,6 +16086,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
|
|
||||||
String get year => _localizedValues[localeCode]['year'];
|
String get year => _localizedValues[localeCode]['year'];
|
||||||
|
|
||||||
|
String get blank => _localizedValues[localeCode]['blank'];
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
final lookupKey = toSnakeCase(key);
|
final lookupKey = toSnakeCase(key);
|
||||||
return _localizedValues[localeCode][lookupKey] ??
|
return _localizedValues[localeCode][lookupKey] ??
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue