我正在寻找键盘快捷键,而不是控制台(如RStudio中标记的)发送到终端。
例如,我想跑步
$ Rscript hello_world.R
Ctrl+Enter
允许我从控制台运行source("hello_world.R")
,但是我正在Rmd文档中使用bash和python块,所以我希望能够在不启动单独的源代码编辑器的情况下运行它们。
答案 0 :(得分:2)
尝试void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'My app title',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
@override
Widget build(BuildContext context) {
return new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new Text(
'You have pushed the button this many times:',
),
new Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
],
),
);
}
}
,我想这就是您想要的。