来自dartlang的dart.io示例中没有发现' uncaught' dartpad上的错误(初学者级别)

时间:2018-03-30 10:25:39

标签: dart

我试图按照" Dart for Absolute Beginner"本书和来自dartlang https://www.dartlang.org/tutorials/dart-vm/cmdline" stdin"接受键盘输入的示例,但是dartpad将显示“未被捕获”#39;对于我尝试的每一个例子。

示例代码:

import 'dart.io'
void main() {
  stdout.writeln('Type something');
  String input = stdin.readLineSync();
  stdout.writeln('You typed: $input');
}

有人能指出我应该添加的内容吗?尝试和捕获块?我该怎么做或达到目的?我只是在第41页的“绝对初学者的飞镖”#34;这本书不要这么做;我希望我知道的很多。

1 个答案:

答案 0 :(得分:1)

DartPad在执行代码之前将Dart转换为JavaScript。

[WARNING] Could not validate integrity of download from gs://mavenbucket/snapshot/com/gkatzioura/storage/CloudStorageTest/1.0-SNAPSHOT/maven-metadata.xml org.eclipse.aether.transfer.ChecksumFailureException: Checksum validation failed, expected 7e0c3c33db781362483c0baed3ba175352945028 but is da39a3ee5e6b4b0d3255bfef95601890afd80709 at org.eclipse.aether.connector.basic.ChecksumValidator.validateExternalChecksums (ChecksumValidator.java:174) at org.eclipse.aether.connector.basic.ChecksumValidator.validate (ChecksumValidator.java:103) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask (BasicRepositoryConnector.java:456) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run (BasicRepositoryConnector.java:360) at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run (RunnableErrorForwarder.java:75) at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute (BasicRepositoryConnector.java:583) at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get (BasicRepositoryConnector.java:232) 仅限于控制台应用程序。

dart:io提供了浏览器中可用API的抽象,但浏览器中没有dart:htmlstdin