How to call a jQuery function from Dart?


This is a typical situation in jQuery:

    aKey: 'some value'

How do you call that using dart:js?

The documentation is a bit cryptic and a similar question that I found here seems dated.


You can do :

main() {
  js.context.callMethod(r'$', ['.myClass'])
      .callMethod('myFunction', [new js.JsObject.jsify({'aKey': 'some value'})]);

Answered By – Alexandre Ardhuin

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *