PackageTrack
Sign in Get early access

js_notifications

An extended NotificationsAPI for Dart managing web notifications.

1.0.0 5.0K downloads/mo #3836 most downloaded on pub.dev cybex-dev/js_notifications

What this package is like to depend on

Last release 29 days ago

26 Jul 2026

Release timing varies

gaps range from 2 months to 1.3 years

Nearly every release is documented

notes for 8 of 8 stable releases

Nothing withdrawn

no release was ever pulled

2 years old

8 releases · first in 2024

1 release in the last 12 months

see the full history below

Release timeline

8 releases · Sep 2024 to Jul 2026
2025 2026
Release Pre-release

Releases

latest 8
  1. 1.0.0 26 Jul 2026
    Release notes

    What's Changed

    Full Changelog: 0.0.5...1.0.0

    Open source →
    Release notes
    • Zero-setup service worker: js_notifications-sw.js now ships as a bundled Flutter asset of the package (deployed at assets/packages/js_notifications/assets/) and is registered automatically — manually copying the file into your app's web/ folder is no longer required. Existing copied files can be deleted; legacy registrations are unregistered automatically on startup.
    • Service worker URL now resolves against the document base URI, fixing deployments under a non-root <base href>.
    • ServiceWorkerManager is now a singleton (ServiceWorkerManager.instance, or the factory constructor to assign event callbacks) — a page has one service worker registration, and the manager owns the listeners attached to it.
    • Service worker setup moved out of the ServiceWorkerManager constructor into an explicit, idempotent init(). The plugin calls it automatically on registration and exposes initialize() (returns whether the worker registered) and isInitialized. Notifications posted before initialisation completes now wait for it instead of being dropped with "No service worker ready".
    • Added registerServiceWorker({url, scope}) — replace the bundled worker with a custom script (e.g. custom sendAction handling), register the bundled worker under a custom scope, or both. The scopeUrl setter now works (previously ineffective): it re-registers the current worker under the new scope. Note: scopes outside the worker script's directory require a Service-Worker-Allowed response header from the server.
    • Fixed: service worker updates are now adopted. When a byte-different worker was deployed, the plugin kept posting to the previous (now redundant) worker and notifications silently stopped working until a page reload. Updates are tracked via updatefound on the plugin's own registration; the new worker is adopted once it reaches activated, with a redundant fallback to the registration's active worker.
    • Fixed: controllerchange no longer adopts navigator.serviceWorker.controller. The controller is the worker controlling the page — never this plugin's worker, whose scope controls no pages — so a controller change (e.g. Flutter's own flutter_service_worker.js updating) could redirect postMessage to a worker that ignores the plugin's protocol.
    • Fixed service worker script bugs: error-logger shadowing in the showNotification catch handler, console.warn argument spreading; renamed SW log tag callkit_swjs_notifications_sw.
    • WebAssembly support: full migration off deprecated dart:html to package:web + dart:js_interop — the package now compiles with flutter build web --wasm.
    • BREAKING: badge is now String? — the URL of the monochrome badge image, per the Web API's Notification.badge (previously mistyped as int?, which browsers ignored; not to be confused with the numeric Badging API, navigator.setAppBadge).
    • BREAKING: vibrate is now List<int>? (previously web.VibratePattern?); package:web types no longer appear in the public API.
    • BREAKING: minimum Flutter version raised to 3.22 (stable WASM toolchain floor).
    • BREAKING: SWEvents constants for events that never dispatch on page-side objects were removed (push, pushsubscriptionchange, sync, install, activate, fetch — these fire inside the worker's own global scope); updatefound was added.
    • Internal: service worker event wiring now uses EventStreamProvider subscriptions; removed ~10 dead no-op event listeners that never fired on page-side objects. ServiceWorkerManager.dispose() now cancels and clears every subscription and resets state, so init() can run again afterwards.
    • Added deepCastMap/deepCastValue helpers (lib/utils/utils.dart) used to normalise dartify() output into the Map<String, dynamic> shape the plugin uses for event payloads.
    • Added bundledSwAssetPath and bundledSwAssetDirMarker constants; defaultScope is retained for legacy-registration migration.
    • isSupported now feature-detects the Notification global (dart:html's Notification.supported has no package:web equivalent).
    • Note: under the WASM runtime, integral JS numbers in notification data payloads may be delivered back to Dart as double — treat round-tripped numbers as num.
    Open source →
  2. 0.0.5 04 Apr 2025
    Release notes

    Full Changelog: 0.0.4...0.0.5

    Open source →
    Release notes
    • Fix NotificationAPI late init
    • Updated docs
    Open source →
  3. 0.0.4 01 Apr 2025
    Release notes

    Changelog:

    • Fix JsNotificationDirection's toString() conversion
    • Added auto to JSNotificationDirection

    Full Changelog: 0.0.2...0.0.4

    Open source →
    Release notes
    • Fix JsNotificationDirection's toString() conversion
    • Added auto to JSNotificationDirection
    Open source →
  4. 0.0.3 28 Jan 2025
    Release notes

    Full Changelog: 0.0.2...0.0.3

    Open source →
    Release notes
    • Added notification accessors and notification getters (via caching)
    • Fixed notification on tap stream not triggering
    Open source →
  5. 0.0.3+1 28 Jan 2025
    Release notes

    Merge branch 'master' into prod

    Open source →
  6. 0.0.3+2 28 Jan 2025
    Release notes

    Merge branch 'master' into prod

    Open source →
    Release notes
    • Updated docs

    • 0.0.3+1

    • Updated docs

    Open source →
  7. 0.0.3+3 28 Jan 2025
    Release notes
    • Updated docs
    • Fix linting
    Open source →
  8. 0.0.1 24 Sep 2024
    Release notes Open source →
    Release notes
    • Initial release
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive