gpt4 book ai didi

debugging - 如何通过浏览器控制台访问我的主要Dart应用程序对象?

转载 作者:行者123 更新时间:2023-12-03 03:02:12 25 4
gpt4 key购买 nike

我想在Dartium中调试我的应用,调用其方法,例如从浏览器控制台中调用APP.getUserState()

使用JavaScript时,我可以通过APPwindow.APP = myAPP全局化。

如何使用Dart应用程序实现相同的效果?

最佳答案

网站/index.dart

class X {
static void p() => print('xxx');
static void q(String a) => print(a);
}

void main() {
// your application code
}

确保上下文设置为Dart并开始使用Dart类:

enter image description here

关于debugging - 如何通过浏览器控制台访问我的主要Dart应用程序对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42688567/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com