Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个需要能够创建虚拟 MIDI 设备的 Flutter Web 应用程序。为此,唯一的选择似乎是使用easymidi NodeJS 包。将 NodeJS 脚本连接到颤振应用程序的最佳方式是什么?
您可以从 Flutter Web 连接到 javascript。最好的方法是使用dart:js库。
dart:js
将您的自定义 js 文件添加到 web 目录 a 确保它已加载
<head> <script src="your.js" defer></script> </head>
例如
function info(text) { alert(text) }
从飞镖调用:
import 'dart:js' as js; js.context.callMethod('info', ['Hello!']);