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')); }