Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package:web usage for migration #55589

Closed
ebala96 opened this issue Apr 29, 2024 · 1 comment
Closed

Package:web usage for migration #55589

ebala96 opened this issue Apr 29, 2024 · 1 comment
Labels
closed-duplicate Closed in favor of an existing report

Comments

@ebala96
Copy link

ebala96 commented Apr 29, 2024

I'm doing a migration to 'package:web' and 'dart:interop'. I'm currently using the context object from the 'dart:js' package to store functions in the window object reference. However, I've noticed that there's no direct way to access the context from the 'package:web'.

I need help with this migration. Below is the code snippet I need to migrate

void _connectJsToFlutter({VoidCallback? then}) {
    js.context['$jsToDartConnectorFN$iframeViewType'] = (js.JsObject window) {
      jsWindowObject = window;
      for (final cb in widget.dartCallBacks) {
        jsWindowObject[cb.name] = cb.callBack;
      }

      jsWindowObject[webOnClickInsideIframeCallback] = (onClickCallbackObject) {
        _handleOnIframeClick(onClickCallbackObject as String);
      };

      webViewXController.connector = jsWindowObject;

      then?.call();
    };
}

Can you provide the correct usage of context and JsObject needed for the migration?

@ebala96 ebala96 changed the title Create an issue Package:web usage for migration Apr 29, 2024
@parlough
Copy link
Member

Closing in favor of dart-lang/web#229 where discussion has continued. Thanks!

@parlough parlough closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
@parlough parlough added the closed-duplicate Closed in favor of an existing report label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

2 participants