dart 搭建环境
搭建环境
The Dart SDK has the libraries and command-line tools that you need to develop Dart web, command-line, and server apps. If you’re developing only mobile apps, then you don’t need the Dart SDK; just install Flutter.
先 下载 Dart SDK https://dart.dev/get-dart 解压缩后配置环境变量。
注意: 配置完成后,需要重新打开 命令行
配置环境变量之前打开的命令行中运行不管用。
创建第一个程序
新建一个 first.dart
文件,运行命令 dart 文件名
,就可以打印输出,代码如下:
void main() { for (int i = 0; i < 5; i++) { print('hello ${i + 1}'); }}
尊贵的董事大人
英文标题不为空时 视为本栏投稿
需要关键字 描述 英文标题