Dashboard overview
This commit is contained in:
parent
55f594bc81
commit
b8f67bcfbc
|
|
@ -1,4 +1,5 @@
|
|||
// Project imports:
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/dashboard_model.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
|
|
@ -23,6 +24,7 @@ class UpdateDashboardSettings implements PersistUI {
|
|||
this.showCurrentPeriod,
|
||||
this.showPreviousPeriod,
|
||||
this.showTotal,
|
||||
this.totalFields,
|
||||
});
|
||||
|
||||
DashboardSettings settings;
|
||||
|
|
@ -33,6 +35,7 @@ class UpdateDashboardSettings implements PersistUI {
|
|||
bool showCurrentPeriod;
|
||||
bool showPreviousPeriod;
|
||||
bool showTotal;
|
||||
BuiltList<String> totalFields;
|
||||
}
|
||||
|
||||
class UpdateDashboardSelection implements PersistUI {
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@ DashboardUISettings dashboardSettingsReducer(
|
|||
.rebuild((b) => b..showPreviousPeriod = action.showPreviousPeriod);
|
||||
} else if (action.showTotal != null) {
|
||||
return state.rebuild((b) => b..showTotal = action.showTotal);
|
||||
} else if (action.totalFields != null) {
|
||||
return state.rebuild((b) => b..totalFields.replace(action.totalFields));
|
||||
}
|
||||
} else if (action is SelectCompany) {
|
||||
//return state.rebuild((b) => b..currencyId = action.company.currencyId);
|
||||
|
|
|
|||
|
|
@ -990,6 +990,15 @@ class _DashboardTotalsSettingsState extends State<_DashboardTotalsSettings> {
|
|||
for (var field in settings.totalFields)
|
||||
ListTile(
|
||||
title: Text(localization.lookup(field)),
|
||||
trailing: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
onPressed: () {
|
||||
store.dispatch(UpdateDashboardSettings(
|
||||
totalFields:
|
||||
settings.totalFields.rebuild((b) => b..remove(field))));
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
CheckboxListTile(
|
||||
value: settings.showCurrentPeriod,
|
||||
|
|
|
|||
Loading…
Reference in New Issue