browser export

This commit is contained in:
yves committed 2026-11-07 19:49:09 +01:00
1 parent 1d974b42a1
commit 0966c6de17
13 files changed
+640 -207

No files matched your search

+13 -6
View File
@@ -1,6 +1,7 @@
# CLAUDE.md
Flutter **plugin** (Linux, Android, Windows) embedding a CesiumJS globe. The
Flutter **plugin** (Linux, Android, Windows) embedding a CesiumJS globe, and
a plain web page (`WebBrowserView`) in the same native web views. The
package is meant to be imported by other apps: keep the public API in
`lib/cesiumjs.dart` small and stable; everything else stays in `lib/src/`.
`example/` is the test/demo app, not part of the package.
@@ -30,13 +31,19 @@ Android test emulator: AVD `cesium_test` (API 35, x86_64), lives in
All platforms share the `cesiumjs/webview` channel protocol (`create`
eagerly builds the web view keyed by a Dart id; other calls address it by id).
- `CesiumViewer` (Dart) renders a black placeholder and reports its global
rect after each paint (`_RenderRectReporter`) → `setRect` over the
`cesiumjs/webview` method channel.
- `NativeWebViewHost` (`native_web_view.dart`, internal) owns one native
view: renders a placeholder, reports its global rect after each paint
(`_RenderRectReporter`) → `setRect` over the `cesiumjs/webview` method
channel, and hides the view (desktop) when `visible` is false, tickers are
muted or its route isn't current (dialog/menu on top). `CesiumViewer` and
`WebBrowserView` are thin wrappers around it.
- `create` takes either `html` (Cesium page, served from the virtual origin)
or `url` (browser view: network page, links opening a window load in place
instead of going to the system browser, no black background).
- `linux/cesiumjs_plugin.cc` creates one `WebKitWebView` per viewer inside a
`GtkOverlay` that holds the `FlView`; `get-child-position` places it at the
reported rect. Methods: `create`, `setRect`, `runJavaScript`,
`openInspector`, `dispose`, `disposeAll` (called once per isolate so hot
reported rect. Methods: `create`, `setRect`, `runJavaScript`, `loadUrl`,
`reload`, `openInspector`, `dispose`, `disposeAll` (called once per isolate so hot
restart doesn't leave orphan views). Events back to Dart: `onMessage`,
`onError`.
- Android (`android/…/CesiumjsPlugin.kt`): `create` builds an