Dashboard overview
This commit is contained in:
parent
8d7cb401cf
commit
5a8c2fd9f9
|
|
@ -204,20 +204,9 @@ class DashboardPanels extends StatelessWidget {
|
||||||
showDialog<AlertDialog>(
|
showDialog<AlertDialog>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertDialog(
|
return _DashboardSettings(
|
||||||
title: Text(localization.settings),
|
|
||||||
key: ValueKey(
|
|
||||||
'__${settings.includeTaxes}_${settings.currencyId}__'),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
child: Text(localization.close.toUpperCase()),
|
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
content: _DashboardSettings(
|
|
||||||
isWide: isWide,
|
isWide: isWide,
|
||||||
viewModel: viewModel,
|
viewModel: viewModel,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -1060,7 +1049,16 @@ class __DashboardSettingsState extends State<_DashboardSettings> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return AlertDialog(
|
||||||
|
title: Text(localization.settings),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
child: Text(localization.close.toUpperCase()),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
content: Container(
|
||||||
|
width: 300,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
|
@ -1091,8 +1089,53 @@ class __DashboardSettingsState extends State<_DashboardSettings> {
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
],
|
],
|
||||||
|
Expanded(
|
||||||
|
child: ReorderableListView(
|
||||||
|
onReorder: (oldIndex, newIndex) {
|
||||||
|
// https://stackoverflow.com/a/54164333/497368
|
||||||
|
// These two lines are workarounds for ReorderableListView problems
|
||||||
|
if (newIndex > settings.totalFields.length) {
|
||||||
|
newIndex = settings.totalFields.length;
|
||||||
|
}
|
||||||
|
if (oldIndex < newIndex) {
|
||||||
|
newIndex--;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
},
|
||||||
|
children: [
|
||||||
for (var dashboardField in settings.totalFields)
|
for (var dashboardField in settings.totalFields)
|
||||||
|
Padding(
|
||||||
|
key: ValueKey(
|
||||||
|
'__${dashboardField.field}_${dashboardField.period}_'),
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 3, horizontal: 10),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.close),
|
||||||
|
onPressed: () {
|
||||||
|
store.dispatch(UpdateDashboardSettings(
|
||||||
|
totalFields: settings.totalFields.rebuild(
|
||||||
|
(b) => b..remove(dashboardField))));
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(width: 20),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
'test',
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
style: Theme.of(context).textTheme.subtitle1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
/*
|
||||||
ListTile(
|
ListTile(
|
||||||
|
key: ValueKey(
|
||||||
|
'__${dashboardField.field}_${dashboardField.period}_'),
|
||||||
title: Text(localization.lookup(dashboardField.field)),
|
title: Text(localization.lookup(dashboardField.field)),
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
icon: Icon(Icons.close),
|
icon: Icon(Icons.close),
|
||||||
|
|
@ -1104,6 +1147,10 @@ class __DashboardSettingsState extends State<_DashboardSettings> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
*/
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
AppButton(
|
AppButton(
|
||||||
label: localization.addField,
|
label: localization.addField,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
|
@ -1129,6 +1176,7 @@ class __DashboardSettingsState extends State<_DashboardSettings> {
|
||||||
.toList())
|
.toList())
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue