ultimate_alarm_clock icon indicating copy to clipboard operation
ultimate_alarm_clock copied to clipboard

Feature: Stopwatch Persistent Notification

Open inderjeet20 opened this issue 10 months ago • 2 comments

Description

Problem

Currently, when the stopwatch is running and the user navigates back to the home screen or switches apps, there’s no visible indication that the stopwatch is still active. Users have to reopen the app to check the elapsed time, which is inconvenient.

Proposed Solution

Implement a persistent notification that:

  • Displays the current running stopwatch time (updates every second).
  • Remains visible as long as the stopwatch is running.
  • Includes actionable buttons:
    • Pause
    • Reset
    • Open App

The notification should automatically dismiss itself when the stopwatch is stopped or reset.

Suggested Implementation

  • Use flutter_local_notifications for displaying notifications.
  • Use android_alarm_manager_plus or a foreground service to update the notification every second while the app is in the background.
  • Connect the notification updates to the StopwatchController (or equivalent stopwatch logic) so that the displayed time is always accurate.
  • Handle actions (Pause/Reset) via intent callbacks or notification action handlers.

Benefits

  • Users can easily track elapsed time without opening the app.
  • Makes the stopwatch feature more robust and professional.
  • Enhances user experience, especially for tasks that require continuous time tracking in the background.

Video

https://github.com/user-attachments/assets/a5a69fe3-5eb8-43ed-87ea-efd454036226


I’d be happy to contribute if guidance or PR support is needed!

Screenshots

No response

inderjeet20 avatar Mar 18 '25 03:03 inderjeet20

@MarkisDev @NishantSinghal19 Please assign this issue to me, I would like to work on this

Mayank4352 avatar Mar 28 '25 18:03 Mayank4352

I very much prefer the stopwatch overlay (mentioned here..#523 #821) rather than a notification. @MarkisDev what are your thoughts on this? We can have either one of them.

In #821 we can also add the respective play, pause, and reset buttons too.

kushchoudhary98 avatar Apr 16 '25 08:04 kushchoudhary98