Dart:修订间差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
第9行: 第9行:
== 範例 ==
== 範例 ==


 先 啟用
 先 初始化目錄


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
第15行: 第15行:
</syntaxhighlight>
</syntaxhighlight>


 然後進到<code>foo/</code>裡面開始修改,首先是<code>pubspec.yaml</code>:
 然後進到<code>foo/</code>裡面 把[[Git]]先弄起來:
 
<syntaxhighlight lang="bash">
cd foo; git init .; git add .; git commit -av -m 'Init'
</syntaxhighlight>
 
開始修改,首先是<code>pubspec.yaml</code>:


<syntaxhighlight lang="yaml">
<syntaxhighlight lang="yaml">

2024年3月13日 (三) 09:47的版本

Dart是一个程式语言。

安装

wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo gpg  --dearmor -o /usr/share/keyrings/dart.gpg; echo 'deb [signed-by=/usr/share/keyrings/dart.gpg arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list; sudo apt update; sudo apt install -y dart; sudo apt clean

范例

先初始化目录:

dart create foo

然后进到foo/里面把Git先弄起来:

cd foo; git init .; git add .; git commit -av -m 'Init'

开始修改,首先是pubspec.yaml

dependencies:
  http: ^1.2.1

然后改bin/foo.dart

void main() {
  print('Hello, world!');
}

相关连结

外部连结