dart-js-interop Questions

3

Let's say I want to create a global object called Hello and add the function world on that object, so that any other JavaScript library in the browser can simply call it with window.Hello.world(); ...
Dunnage asked 22/8, 2017 at 8:16

2

Solved

I have a Flutter Web project. I have the following HTML script that I need to put into HtmlElementView: <script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID"></scr...
Hoecake asked 19/4, 2020 at 1:57

2

Solved

Edit: Here is a minimal project that illustrates my issue. You can see the error described by serving it to the browser: pub get and then either pub serve (dartium) or pub build --mode=debug (other...
Ceporah asked 21/12, 2016 at 23:50

1

Solved

I have the following functional javascript code to demonstrate what I want to achieve. It should output the object passed to the method, and then the value of the property "a". <!DOCTY...
Wildeyed asked 15/10, 2020 at 13:59

1

Solved

I'm trying to await a custom global JavaScript function: var promise = js.context.callMethod('performAuthenticationInNewWindow', [uri.toString()]); print(promise); var qs = await promiseToFuture...
Bishopric asked 16/7, 2020 at 14:28

1

Solved

I need widget with bpmn.js view: https://github.com/bpmn-io/bpmn-js Used HtmlElementView: // ignore: undefined_prefixed_name ui.platformViewRegistry .registerViewFactory('bpmn_view', (int view...
Pichardo asked 18/2, 2020 at 7:53

1

Solved

clientside.js async function callClientAsyncFuncWithResult () { let result = await someService.request(); return result; } page.dart import 'dart:js' as js; var result = js.context.callMeth...
Talaria asked 7/4, 2019 at 18:56

2

Solved

Everywhere in Dart documentation it is recommended to use js package for javascript interoperability. However, I have recently found that dart:js package exists in SDK that seems to have similar (...
Swaziland asked 18/10, 2013 at 14:7

3

Solved

I'm a bit of a newb to dart, and trying to get my feet wet by writing some library functions in it. While I've had no problem calling javascript functions from dart, I'd love to be able to call d...
Gravitate asked 27/3, 2013 at 20:49

1

Solved

Is there any way to call a JavaScript function named call() (in a nested object) from Dart or do I have to wait for Dart 2.0 from which the special handling of call() might get removed? I have a J...
Undergrown asked 5/12, 2017 at 16:7

2

Solved

When using a third-party JavaScript library in my Dart project, I manually go through the library's documentation and iterate through its properties and methods to build the Dart code through a ser...
Ganger asked 13/4, 2015 at 13:11

1

Solved

index.html (head) <script> var callDartMethod = function(dartObject) { return dartObject.fullName(); } </script> index.dart import 'package:js/js.dart'; @Js() // about to being ...
Helium asked 16/10, 2015 at 15:43

3

Solved

This is a typical situation in jQuery: $(".myClass").myFunction({ aKey: 'some value' }); How do you call that using dart:js? The documentation is a bit cryptic and a similar question that I f...
Paleogeography asked 24/12, 2013 at 5:28

1

After announcing new strategy for Dart, i decided to change include from <script type="application/dart" src="/dart/script.dart"></script> to <script type="text/javascript" src="...
Sirrah asked 2/4, 2015 at 6:11

2

Solved

The problem I'm currently working on a JavaScript library, and in order to reduce the amount of bugs I thought that my library might benefit from using Dart's static typing mechanism. First, becaus...
Giamo asked 18/5, 2014 at 15:20

1

Solved

No, this isn't the same as the other question of the same name. There are seemingly identical packages which seem to do this, but with different apis. http://dart-lang.github.io/js-interop/docs/...
Pussyfoot asked 15/12, 2013 at 1:8

1

Solved

I need to access a JavaScript object's this from a Dart function. I'm effectively adding a new method to a JavaScript object, via Dart-JS interop. I need to access properties that are on the JavaSc...
Chalcanthite asked 17/7, 2013 at 5:26
1

© 2022 - 2024 — McMap. All rights reserved.