DartでHelloWorldプログラムを実装してみた

# 概要
DartでHelloWorldプログラムを実装してみました。

# プログラム作成
以下のプログラムを作成しました。
```hello.dart
void main(){
  print("Hello World");
}
```

# 環境構築＆実行
aptで必要なアプリケーションをインストールしました。
```
$ sudo apt install bash clang curl git libcanberra-gtk-module libglu1-mesa unzip xz-utils
```
snapでflutterをインストールしました。
```
$ sudo snap install flutter --classic
flutter 0+git.ccbc698 from Flutter Team✓ installed
```
そのまま実行しようとしたらエラー。初期化が必要とのこと。
```
$ flutter.dart hello.dart 
Flutter not initialized, please run the flutter command once
```
flutterを初期化しました。
```
$ flutter
Initializing Flutter
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  182k  100  182k    0     0   419k      0 --:--:-- --:--:-- --:--:--  418k
Downloading https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.10.2-stable.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  564M  100  564M    0     0  1034k      0  0:09:18  0:09:18 --:--:--  779k
Flutter initialized
Flutter 3.10.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9cd3d0d9ff (7 days ago) • 2023-05-23 20:57:28 -0700
Engine • revision 90fa3ae28f
Tools • Dart 3.0.2 • DevTools 2.23.1

  ╔════════════════════════════════════════════════════════════════════════════╗
  ║                 Welcome to Flutter! - https://flutter.dev                  ║
  ║                                                                            ║
  ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
  ║ statistics and basic crash reports. This data is used to help improve      ║
  ║ Flutter tools over time.                                                   ║
  ║                                                                            ║
  ║ Flutter tool analytics are not sent on the very first run. To disable      ║
  ║ reporting, type 'flutter config --no-analytics'. To display the current    ║
  ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out    ║
  ║ event will be sent, and then no further information will be sent by the    ║
  ║ Flutter tool.                                                              ║
  ║                                                                            ║
  ║ By downloading the Flutter SDK, you agree to the Google Terms of Service.  ║
  ║ Note: The Google Privacy Policy describes how data is handled in this      ║
  ║ service.                                                                   ║
  ║                                                                            ║
  ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and  ║
  ║ crash reports to Google.                                                   ║
  ║                                                                            ║
  ║ Read about data we send with crash reports:                                ║
  ║ https://flutter.dev/docs/reference/crash-reporting                         ║
  ║                                                                            ║
  ║ See Google's privacy policy:                                               ║
  ║ https://policies.google.com/privacy                                        ║
  ╚════════════════════════════════════════════════════════════════════════════╝


The Flutter CLI developer tool uses Google Analytics to report usage and diagnostic data
along with package dependencies, and crash reporting to send basic crash reports.
This data is used to help improve the Dart platform, Flutter framework, and related tools.

Telemetry is not sent on the very first run.
To disable reporting of telemetry, run this terminal command:

flutter --disable-telemetry.
If you opt out of telemetry, an opt-out event will be sent,
and then no further information will be sent.
This data is collected in accordance with the
Google Privacy Policy (https://policies.google.com/privacy).

You have received two consent messages because the flutter tool is migrating to a new analytics system. Disabling analytics collection will disable both the legacy and new analytics collection systems.
You can disable analytics reporting by running `flutter --disable-telemetry`
```
プログラムを再実行してみました。
```
$ flutter.dart hello.dart 
Hello World
```
今度は無事動きました。

# まとめ
何かの役に立てばと。