From afe481305c11121062b8b7dd9afd5db1f6fe0778 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Thu, 2 Mar 2023 20:35:20 +0100 Subject: [PATCH] Add TaskProvider to Workout --- lib/widgets/workout_timer_widget.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/widgets/workout_timer_widget.dart b/lib/widgets/workout_timer_widget.dart index 59f67d4..a85a09e 100644 --- a/lib/widgets/workout_timer_widget.dart +++ b/lib/widgets/workout_timer_widget.dart @@ -2,7 +2,9 @@ import 'dart:async'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:smoke_cess_app/providers/tasks_provider.dart'; import 'package:smoke_cess_app/providers/workout_provider.dart'; +import 'package:smoke_cess_app/services/pages_service.dart'; import 'package:smoke_cess_app/widgets/timer_widget.dart'; import '../providers/timer_provider.dart'; @@ -15,6 +17,7 @@ class WorkoutTimerWidget extends StatelessWidget { Widget build(BuildContext context) { TimerProvider timerProvider = context.watch(); WorkoutProvider workoutProvider = context.watch(); + TasksProvider tasksProvider = context.read(); if (workoutProvider.isPhaseComplete && !workoutProvider.isWorkoutComplete) { Timer(const Duration(milliseconds: 1), () => workoutProvider.nextPhase()); @@ -26,6 +29,7 @@ class WorkoutTimerWidget extends StatelessWidget { () => showMotivationPopup(context, (double value) { workoutProvider.motivationAfter = value.toInt(); workoutProvider.saveWorkout(); + tasksProvider.setTaskDone(Pages.timer); }, 'Motivation nach dem Training')); }