fireship.io icon indicating copy to clipboard operation
fireship.io copied to clipboard

snippets/using-js-with-flutter-web/

Open utterances-bot opened this issue 2 years ago • 4 comments

How to use JS with Flutter Web

How to interop between JavaScript and Dart with Flutter Web

https://fireship.io/snippets/using-js-with-flutter-web/

utterances-bot avatar Apr 29 '22 14:04 utterances-bot

Hi , i cannot able to get Output from ur code it shows error

Error: NoSuchMethodError: 'alertMessage' method not found Receiver: Instance of 'Window' Arguments: ["Flutter is calling upon JavaScript!"] at Object.throw_ [as throw] (http://localhost:40909/dart_sdk.js:5067:11) at js.JsObject._fromJs.callMethod (http://localhost:40909/dart_sdk.js:62058:19) at main$ (http://localhost:40909/packages/responsive_check/main.dart.lib.js:602:16) at main (http://localhost:40909/web_entrypoint.dart.lib.js:36:29) at main.next () at http://localhost:40909/dart_sdk.js:40571:33 at _RootZone.runUnary (http://localhost:40909/dart_sdk.js:40441:59) at _FutureListener.thenAwait.handleValue (http://localhost:40909/dart_sdk.js:35363:29) at handleValueCallback (http://localhost:40909/dart_sdk.js:35931:49) at Function._propagateToListeners (http://localhost:40909/dart_sdk.js:35969:17) at _Future.new.[_completeWithValue] (http://localhost:40909/dart_sdk.js:35817:23) at http://localhost:40909/dart_sdk.js:34998:46 at _RootZone.runUnary (http://localhost:40909/dart_sdk.js:40441:59) at _FutureListener.then.handleValue (http://localhost:40909/dart_sdk.js:35363:29) at handleValueCallback (http://localhost:40909/dart_sdk.js:35931:49) at Function._propagateToListeners (http://localhost:40909/dart_sdk.js:35969:17) at _Future.new.[_completeWithValue] (http://localhost:40909/dart_sdk.js:35817:23) at async._AsyncCallbackEntry.new.callback (http://localhost:40909/dart_sdk.js:35838:35) at Object._microtaskLoop (http://localhost:40909/dart_sdk.js:40708:13) at _startMicrotaskLoop (http://localhost:40909/dart_sdk.js:40714:13) at http://localhost:40909/dart_sdk.js:36191:9

pradeep14598 avatar Apr 29 '22 14:04 pradeep14598

Hi Everyone, Hope you are doing good. I have one requirement. Hi , Is it possible to load and display Three.js content in Flutter Web Application. Also I want interactions with JS to Flutter and Flutter to JS. There is multiple plugins are there to load web URL in Flutter Mobile App. I don't need for mobile.

suryanadiminti99 avatar Jul 27 '22 09:07 suryanadiminti99

Heyy I am really impressed with your method but while compiling the flutter application, I am getting the following error.

: Error: Not found: 'dart:js'

Rusira1234 avatar Aug 07 '22 13:08 Rusira1234

want to call app.js functions from web console and it will reflect in some flutter view. --- any suggestion how can we achieve this

ChiranjibGanguly avatar Sep 21 '22 11:09 ChiranjibGanguly