起步
PPG007 ... 2022-3-3 Less than 1 minute
# 起步
# 安装 Dart
sudo apt-get update
sudo apt-get install apt-transport-https
sudo sh -c 'wget -qO- https://dl.google.com/linux/linux_signing_key.pub | apt-key add -'
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list'
sudo apt-get update
sudo apt-get install dart
1
2
3
4
5
6
2
3
4
5
6
使用 Visual Studio Code 安装 Dart 插件即可。
# 一个简单地 Dart 程序
创建 hello.dart:
void hello(String name) {
print("Hello $name");
}
void main(List<String> args) {
var name = "PPG007";
hello(name);
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8