Skip to content

Added the Notification.permission raw value - removed dart:html referenaces.#1

Open
large wants to merge 1 commit intocybex-dev:masterfrom
large:show_permission
Open

Added the Notification.permission raw value - removed dart:html referenaces.#1
large wants to merge 1 commit intocybex-dev:masterfrom
large:show_permission

Conversation

@large
Copy link
Copy Markdown

@large large commented Nov 20, 2025

Thank you for this great package!
I have made some modifications that might be useful:

Notification.permission is a three state value; "default,granted,denied" where "default" is the only state a user will be shown a popup to accept or block notifications. Added as a simple string, to handle states that might be added in the future.

Removed the dart:html package to notification_api.dart since it depreciated.
Made a hacky "isSupported" since that is no longer a function for package:web/web.dart anymore.
Removing the dart:html will make this package compile & run in WASM ( https://docs.flutter.dev/platform-integration/web/wasm )

Modified the example to show Notification.permission and a simple request button. That way end user can test states.
Added tapStream and moved the "default" values from actionStream to it.
Now links will be opened when tapped. Removed the dart:html package replaced it with package:web/web.dart that will call the window.open.

Bumped the version to 0.0.6 if you find changes acceptable.

Notification.permission is a three state value; "default,granted,denied" where "default" is the only state a user will be shown a popup to accept or block notifications.
Added as a simple string, to handle states that might be added in the future.

Removed the dart:html package to notification_api.dart since it depreciated. Made a hacky "isSupported" since that is no longer a function for package:web/web.dart anymore.

Modified the example to show Notification.permission and a simple request button, so end user can test states.
Also added tapStream and moved the "default" values from actionStream to it. Now links will be opened when tapped.
Removed the dart:html package replaced it with package:web/web.dart

Bumped the version to 0.0.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant