omchiii / model_viewer_plus.dart

A Flutter widget for rendering interactive 3D models in the glTF and GLB formats.
https://pub.dev/packages/model_viewer_plus
Apache License 2.0
91 stars 51 forks source link

onWebViewCreated doesn't get called #72

Open jimmy-vo opened 1 year ago

jimmy-vo commented 1 year ago

Describe the bug onWebViewCreated doesn't get called. I didn't verify this on mobile platforms

To reproduce Steps to reproduce the behavior:

  1. Use lib/animation/change_animation_speed.dart
  2. Add webview_flutter: 3.0.4 to pubspec.yaml
  3. Add
    onWebViewCreated: (WebViewController controller) {
            print("get Controller");
    },
  4. onWebViewCreated never gets called

Expected behavior onWebViewCreated gets called on the web

Desktop (please complete the following information):

Additional context I am not sure if I understand #71, but the changes doesn't seem to do anything with that parameter on the web platform?

khalid-alsaleh-dev commented 1 year ago

Anything new about this issue?

gri38 commented 1 year ago

Hello.

First, thanks for your excellent project, it's very valuable !

I have also that need: to get and set some controls: offset of the scene, rotation, .... I use ModelViewer in a web application, and I've seen that javascriptChannels and onWebViewCreated are not implemented in the your package/src/shim/model_viewer_plus_web.dart

Can you at least some visibility if you expect to do it soon or not?

Thanks.

JudahMcNicholl commented 8 months ago

Just bumping this up to see If there is going to be anything related to the model_viewer_plus_web for this issue?

naychrist commented 8 months ago

does this mean there is currently no way to pass a message back to dart from model viewer JS? I am wrestling with this now as want to call dart code when annotations are pressed

naychrist commented 8 months ago

Looking into this further WebViewController is required for this to have JS > dart comms but only exists on mobile. The package therefore uses HtmlElementView instead for web but no way to use JS channels with it :/ Looks like it would take a refactoring of the web implementation to use something else to support this (maybe dart JS interop somehow?).