有没有办法在按下某个键之前停止执行Dart进程?
这将是这样的:
<input id="nextstep" type="button" value="nextstep" />
Run Code Online (Sandbox Code Playgroud)
void main() {
while(true) {
// Do something here to pause the loop
// until the nextstep button is pressed
}
}
Run Code Online (Sandbox Code Playgroud)
您只需添加一个keyPress监听器input即可开始一些额外的处理.
void main() {
final input = querySelector("#nextstep");
input.onKeyPress.listen((e){
nextProcessingStep();
});
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
287 次 |
| 最近记录: |