MaikuB/flutter_local_notifications

Changing notification details for a Linux notification doesn't apply immediately unless its old one is deleted first.

Open

#2.595 geöffnet am 3. Apr. 2025

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Dart (1.187 Forks)batch import
help wanted

Repository-Metriken

Stars
 (2.208 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 59m) (4 gemergte PRs in 30 T)

Beschreibung

Describe the bug

If I create an urgent notification on Linux (Gnome 48), it appears as it should. However if I change the notification details by lowering the urgency, then display the same notification again, the result is that the notification is re-shown with the original urgency.

To Reproduce

  1. Set urgency of notification details to be critical, on Linux
  2. Create urgent notification
  3. Update notification details object with lower priority
  4. Create new notification with the same notification details object
  5. See that the incorrect urgency is applied
  6. Create new notification
  7. See that the desired notification type is now applied on the third notification

Expected behavior

The expectation is that the less urgent method will be used on the second and third notifications.

Sample code to reproduce the problem

Here is the commit I used to work around this issue in my app:

https://github.com/sandpiper-codes/open_alert_viewer/commit/8b2d5bf6e0bca4866fb001e51e58aed993b2c5c5

I decided to conditionally remove the previous notification before showing a new one, but perhaps removing every time would have the same effect.

Contributor Guide