我使用过在JavaScript应用程序上运行的Notifications,当您不必一直在需要确认某些重要信息的时候一直看着应用程序时,这非常有用。我尝试在Dart上复制一些工作,但是在编译为JS Chrome时显示引用错误。
您知道它是否即将在Chrome中实现吗?还是将继续试验?
提前致谢
这是尝试调用Notification API的函数。没有通知行,一切正常,当我添加通知行时,出现此错误“未捕获的ReferenceError:未定义requestPermission”,将代码作为JavaScript运行。 (我正在导入'dart:html')
void revisarInput() {
if ( valorLogin != '' ) {
indicador = true;
_ws.send( Util.formatearJsonSocket( 'loginPwd', { 'pwd': int.parse( valorLogin )}));
}
Notification.requestPermission();
}
最佳答案
这是dart2js https://code.google.com/p/dart/issues/detail?id=22483中的一个错误,已在Dart 1.9中修复。
关于dart - 在Dart上使用Notification API时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23748890/