Skip to content

Detect Dart web apps via dart:js_interop libraries - #10045

Open
hkarmoush wants to merge 5 commits into
flutter:masterfrom
hkarmoush:detect-web-js-interop
Open

hkarmoush wants to merge 5 commits into
flutter:masterfrom
hkarmoush:detect-web-js-interop

Conversation

@hkarmoush

Copy link
Copy Markdown
Contributor

Fixes #9973

ConnectedApp.isDartWebApp previously only checked for dart:html, so dart2wasm / package:web apps were not detected. It now also checks dart:js_interop and dart:js_interop_unsafe, short-circuiting on the first match.

  • Adds unit tests for ConnectedApp
  • Adds libraryUriAvailable to FakeServiceManager
  • Updates CHANGELOG and release notes

@hkarmoush
hkarmoush requested review from a team and kenzieschmoll as code owners October 17, 2026 20:33
@hkarmoush
hkarmoush requested review from srawlins and removed request for a team October 17, 2026 20:33

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for recognizing Dart and Flutter web apps compiled with WebAssembly (Wasm) or modern web libraries (such as package:web) by checking for the presence of dart:js_interop or dart:js_interop_unsafe in addition to dart:html. It also introduces comprehensive unit tests for this detection logic. However, a critical issue was identified where serviceManager can be null (e.g., in offline apps), which would cause a null pointer exception when accessing isDartWebApp. This needs to be safely handled.

@hkarmoush
hkarmoush force-pushed the detect-web-js-interop branch from a8a2f0c to 190f2c5 Compare October 26, 2026 00:34

@srawlins srawlins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks much!

@hkarmoush
hkarmoush force-pushed the detect-web-js-interop branch from dbc001c to d2ae705 Compare November 13, 2026 10:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check for modern web libraries to determine if an app is a web app

3 participants