Commit dffb8db3 authored by Administrator's avatar Administrator

button on activity detail screen to exclude from / include into analysis

parent ebd7a749
......@@ -358,6 +358,25 @@ class _ShowActivityScreenState extends State<ShowActivityScreen> {
),
onPressed: () => parse(),
),
if(widget.activity.excluded == true)
RaisedButton.icon(
color: MyColor.include,
icon: MyIcon.filter,
textColor: MyColor.textColor(backgroundColor: MyColor.include),
label: const Expanded(
child: Text('Include in Analysis'),
),
onPressed: () => include(),
)
else RaisedButton.icon(
color: MyColor.exclude,
icon: MyIcon.filter,
textColor: MyColor.textColor(backgroundColor: MyColor.exclude),
label: const Expanded(
child: Text('Exclude from Analysis'),
),
onPressed: () => exclude(),
),
if (<String>['new', 'downloaded', 'persisted']
.contains(widget.activity.state))
RaisedButton.icon(
......@@ -453,6 +472,18 @@ class _ShowActivityScreenState extends State<ShowActivityScreen> {
setState(() {});
}
Future<void> exclude() async {
widget.activity.excluded = true;
await widget.activity.save();
setState(() {});
}
Future<void> include() async {
widget.activity.excluded = false;
await widget.activity.save();
setState(() {});
}
Future<void> delete() async {
await widget.activity.delete();
Navigator.of(context).pop();
......
......@@ -40,6 +40,7 @@ class MyIcon {
);
static const Icon event = Icon(Icons.event);
// F
static const Icon filter = Icon(Icons.sync_disabled);
static const Icon finished = Icon(Icons.check_box);
static final Icon finishedWhite = Icon(
Icons.sentiment_very_satisfied,
......
......@@ -59,6 +59,8 @@ class MyColor {
static Color delete = danger;
static Color navigate = brightGoldenYellow;
static Color log = aquaAccent;
static Color exclude = pinkRoseAccent;
static Color include = mediumGray;
static Color athlete = sunFlowerAccent;
static Color activity = aquaAccent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment