Using EvaluateJavascript to interact with BabylonJS models through Flutter Webview

Hey Christian,

You’ll need to expose JS APIs that you can invoke from compiled Dart code.

The easiest way to do that is with package:js – see js | Dart Package

You create a stub or facade for the target JS code in Dart and then invoke it directly from your Dart code.

For an of examples of how this works, see GitHub - google/chartjs.dart: Dart API for Chart.js

It’d be a LOT of work to expose all of this API to Dart (although it’d be cool to see!). You’ll likely just want to expose the APIs you need.

Start with something super small and build up from there!

2 Likes