<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dart（ダート、ダーツ） | Men of Letters（メン・オブ・レターズ） &#8211; 論理的思考/業務改善/プログラミング</title>
	<atom:link href="https://laboratory.kazuuu.net/category/dart%EF%BC%88%E3%83%80%E3%83%BC%E3%83%88%E3%80%81%E3%83%80%E3%83%BC%E3%83%84%EF%BC%89/feed/" rel="self" type="application/rss+xml" />
	<link>https://laboratory.kazuuu.net</link>
	<description></description>
	<lastBuildDate>Thu, 10 Dec 2020 03:13:58 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://laboratory.kazuuu.net/wp-content/uploads/2021/02/cropped-L-32x32.png</url>
	<title>Dart（ダート、ダーツ） | Men of Letters（メン・オブ・レターズ） &#8211; 論理的思考/業務改善/プログラミング</title>
	<link>https://laboratory.kazuuu.net</link>
	<width>32</width>
	<height>32</height>
</image> 
<atom:link rel="hub" href="https://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="https://pubsubhubbub.superfeedr.com"/><atom:link rel="hub" href="https://websubhub.com/hub"/>	<item>
		<title>Webプログラミング言語「Dart」をインストールする（Windows10）</title>
		<link>https://laboratory.kazuuu.net/install-a-web-programming-language-dart-windows-10/</link>
					<comments>https://laboratory.kazuuu.net/install-a-web-programming-language-dart-windows-10/#respond</comments>
		
		<dc:creator><![CDATA[小林]]></dc:creator>
		<pubDate>Thu, 10 Dec 2020 02:31:00 +0000</pubDate>
				<category><![CDATA[Dart（ダート、ダーツ）]]></category>
		<guid isPermaLink="false">https://laboratory.kazuuu.net/?p=5678</guid>

					<description><![CDATA[Dartのインストールについて解説しています。（Windows10） 目次 ■PC環境■Dartをインストールする■アプリを作成する■アプリを実行する■アプリの変更とカスタマイズをする■本番用にコンパイルする ■PC環境 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Dartのインストールについて解説しています。（Windows10）</p>

  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-2" checked><label class="toc-title" for="toc-checkbox-2">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">■PC環境</a></li><li><a href="#toc2" tabindex="0">■Dartをインストールする</a></li><li><a href="#toc3" tabindex="0">■アプリを作成する</a></li><li><a href="#toc4" tabindex="0">■アプリを実行する</a></li><li><a href="#toc5" tabindex="0">■アプリの変更とカスタマイズをする</a></li><li><a href="#toc6" tabindex="0">■本番用にコンパイルする</a></li></ol>
    </div>
  </div>

<h2><span id="toc1">■PC環境</span></h2>
<p>・Windows10、Administrator（管理者）アカウント</p>
<p>・chocolatey 0.10.15</p>
<h2><span id="toc2">■Dartをインストールする</span></h2>
<p>Dartをインストールするには、ソフトウェア開発キット (SDK) が必要です。インストールするには、Windows10のデスクトップ画面の検索ボックスで「コマンドプロンプト」と入力します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2020/11/スクリーンショット-2020-11-06-091456.png"><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-4263" src="https://laboratory.kazuuu.net/wp-content/uploads/2020/11/スクリーンショット-2020-11-06-091456-300x261.png" alt="" width="300" height="261" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2020/11/スクリーンショット-2020-11-06-091456-300x261.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2020/11/スクリーンショット-2020-11-06-091456-768x668.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2020/11/スクリーンショット-2020-11-06-091456.png 784w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>入力すると、「最も一致する検索結果」に「コマンドプロンプト」が表示されますので、こちらをクリックします。クリックすると、コマンドプロンプトが起動します。</p>
<pre>choco install dart-sdk</pre>
<p>起動後、上記のコマンドを入力し、Enterキーを押します。</p>
<blockquote><p>Chocolatey v0.10.15<br />
Installing the following packages:<br />
dart-sdk<br />
By installing you accept licenses for the packages.<br />
Progress: Downloading dart-sdk 2.10.4&#8230; 100%</p>
<p>dart-sdk v2.10.4 [Approved]<br />
dart-sdk package files install completed. Performing other installation steps.<br />
The package dart-sdk wants to run &#8216;chocolateyInstall.ps1&#8217;.<br />
Note: If you don&#8217;t run this script, the installation will fail.<br />
Note: To confirm automatically next time, use &#8216;-y&#8217; or consider:<br />
choco feature enable -n allowGlobalConfirmation<br />
Do you want to run the script?([Y]es/[A]ll &#8211; yes to all/[N]o/[P]rint):</p></blockquote>
<p>Enterキーを押すと「Do you want to run the script?（スクリプトを実行しますか？）」と質問されますので、「Y」と入力し、Enterキーを押します。</p>
<blockquote><p>PATH environment variable does not have C:\tools\dart-sdk\bin in it. Adding&#8230;<br />
PATH environment variable does not have C:\Users\Administrator\AppData\Roaming\Pub\Cache\bin in it. Adding&#8230;<br />
Downloading dart-sdk 64 bit<br />
from &#8216;https://storage.googleapis.com/dart-archive/channels/stable/release/2.10.4/sdk/dartsdk-windows-x64-release.zip&#8217;<br />
Progress: 100% &#8211; Completed download of C:\Users\Administrator\AppData\Local\Temp\dart-sdk\2.10.4\dartsdk-windows-x64-release.zip (150.05 MB).<br />
Download of dartsdk-windows-x64-release.zip (150.05 MB) completed.<br />
Hashes match.<br />
Extracting C:\Users\Administrator\AppData\Local\Temp\dart-sdk\2.10.4\dartsdk-windows-x64-release.zip to C:\tools&#8230;<br />
C:\tools<br />
Environment Vars (like PATH) have changed. Close/reopen your shell to<br />
see the changes (or in powershell/cmd.exe just type `refreshenv`).<br />
The install of dart-sdk was successful.<br />
Software installed to &#8216;C:\tools&#8217;</p>
<p>Chocolatey installed 1/1 packages.<br />
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).</p>
<p>Did you know the proceeds of Pro (and some proceeds from other<br />
licensed editions) go into bettering the community infrastructure?<br />
Your support ensures an active community, keeps Chocolatey tip top,<br />
plus it nets you some awesome features!<br />
https://chocolatey.org/compare</p></blockquote>
<p>Enterキーを押すと、インストールが開始され、「The install of dart-sdk was successful.」と表示されます。これが表示されれば、Dart SDKのインストールが正常に完了しました。</p>
<p>インストール後、環境変数（PATHなど）が変更されているので、コマンドプロンプトは閉じます。</p>
<h2><span id="toc3">■アプリを作成する</span></h2>
<p>正常にインストールが完了した後は、アプリを作成します。</p>
<pre>dart create -t console-full test01</pre>
<p>再度、コマンドプロンプトを起動し、上記のコマンドを入力し、Enterキーを押します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-104903.png"><img decoding="async" class="alignnone size-medium wp-image-5681" src="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-104903-300x61.png" alt="" width="300" height="61" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-104903-300x61.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-104903-1024x209.png 1024w, https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-104903-768x157.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-104903.png 1250w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<blockquote><p>The Dart tool uses Google Analytics to anonymously report feature usage<br />
statistics, and crash reporting to send basic crash reports. This data is used to help improve the Dart platform and tools over time.<br />
To disable reporting of anonymous tool usage statistics in general, run<br />
the command: `dart &#8211;disable-analytics`.（DartツールはGoogle Analyticsを使って機能の利用状況を匿名でレポートする<br />
統計情報、および基本的なクラッシュレポートを送信するクラッシュレポート。このデータはDartのプラットフォームとツールの改善に役立てられる。<br />
匿名のツール使用統計のレポートを無効にするには、次のコマンドを実行します。<br />
コマンド:`dart&#8211;disable-analytics`）</p></blockquote>
<p>Enterキーを押すと上記のメッセージが表示されます。</p>
<pre>Creating C:\Users\Administrator\test01 using template console-full...

  .gitignore
  CHANGELOG.md
  README.md
  analysis_options.yaml
  bin\test01.dart
  lib\test01.dart
  pubspec.yaml
  test\test01_test.dart

Running pub get...
  Resolving dependencies...
  Downloading pedantic 1.9.2...
  Downloading meta 1.2.4...
  Downloading test 1.15.7...
  Downloading test_core 0.3.11+4...
  Downloading test_api 0.2.18+1...
  Downloading matcher 0.12.9...
  Downloading package_config 1.9.3...
  Downloading shelf_static 0.2.8...
  Downloading stream_channel 2.0.0...
  Downloading shelf_packages_handler 2.0.0...
  Downloading path 1.7.0...
  Downloading io 0.3.4...
  Downloading source_map_stack_trace 2.0.0...
  Downloading http 0.12.2...
  Downloading term_glyph 1.1.0...
  Downloading js 0.6.2...
  Downloading charcode 1.1.3...
  Downloading shelf_web_socket 0.2.3...
  Downloading http_multi_server 2.2.0...
  Downloading convert 2.1.1...
  Downloading string_scanner 1.0.5...
  Downloading coverage 0.14.2...
  Downloading source_maps 0.10.9...
  Downloading boolean_selector 2.0.0...
  Downloading args 1.6.0...
  Downloading webkit_inspection_protocol 0.7.4...
  Downloading logging 0.11.4...
  Downloading pool 1.4.0...
  Downloading stack_trace 1.9.6...
  Downloading mime 0.9.7...
  Downloading shelf 0.7.9...
  Downloading http_parser 3.1.4...
  Downloading async 2.4.2...
  Downloading node_preamble 1.4.12...
  Downloading glob 1.2.0...
  Downloading node_io 1.2.0...
  Downloading node_interop 1.2.1...
  Downloading typed_data 1.2.0...
  Downloading source_span 1.7.0...
  Downloading file 5.2.1...
  Downloading intl 0.16.1...
  Downloading web_socket_channel 1.1.0...
  Downloading crypto 2.1.5...
  Downloading yaml 2.2.1...
  Downloading analyzer 0.41.1...
  Downloading _fe_analyzer_shared 14.0.0...
  Downloading cli_util 0.2.0...
  Downloading pub_semver 1.4.4...
  Downloading watcher 0.9.7+15...
  Downloading collection 1.14.13...
  Downloading vm_service 4.2.0...
  Changed 51 dependencies!

Created project test01! In order to get started, type:

  cd test01

</pre>
<p>表示された後に、アプリの作成が行われ「Created project」と表示されます。これが表示されれば、アプリの作成は完了となります。</p>
<h2><span id="toc4">■アプリを実行する</span></h2>
<p>完了後、アプリを実行します。</p>
<pre>cd test01</pre>
<p>アプリを実行するには、まず作成されたアプリに移動するために、cdコマンドを入力し、Enterキーを押します。</p>
<pre>dart run</pre>
<p>Enterキーを押した後、上記のコマンドを入力し、Enterキーを押します。</p>
<pre>Hello world: 42!</pre>
<p>Enterキーを押すと、アプリが実行され、上記のメッセージが表示されます。これが表示されれば、アプリの実行は完了となります。</p>
<h2><span id="toc5">■アプリの変更とカスタマイズをする</span></h2>
<p>完了後、アプリの変更とカスタマイズを行ってみます。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111240.png"><img decoding="async" class="alignnone size-medium wp-image-5682" src="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111240-300x190.png" alt="" width="300" height="190" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111240-300x190.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111240-768x486.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111240.png 830w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>アプリの変更とカスタマイズを行う場合は、作成したアプリ内の「lib/（アプリ名）.dart」のファイルをコードエディタで変更します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111512.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-5683" src="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111512-300x134.png" alt="" width="300" height="134" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111512-300x134.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111512-768x342.png 768w, https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111512.png 997w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>※今回は Visual Studio Codeを使用しています。<a href="https://dart.dev/guides/language/language-tour#arithmetic-operators">Dartの算術演算子を使ってみます。</a></p>
<p>コードエディタで変更後、ファイルを保存します。</p>
<pre>dart run</pre>
<p>保存後、コマンドプロンプトで作成したアプリ内に移動し、上記のコマンドを入力し、Enterキーを押します。</p>
<p><a href="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111935.png"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-5684" src="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111935-300x97.png" alt="" width="300" height="97" srcset="https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111935-300x97.png 300w, https://laboratory.kazuuu.net/wp-content/uploads/2020/12/スクリーンショット-2020-12-10-111935.png 716w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Enterキーを押すと、変更したコードの内容でアプリが実行されることを確認できました。</p>
<h2><span id="toc6">■本番用にコンパイルする</span></h2>
<p>確認できましたので、本番用にコンパイル（コンピュータが実行可能な形式に変換する）を行ってみます。</p>
<pre>dart compile exe bin/（アプリ名）.dart</pre>
<p>コンパイルする場合は、コマンドプロンプトで作成したアプリ内に移動し、上記のコマンドを入力し、Enterキーを押します。</p>
<blockquote><p>Generated: c:\users\administrator\（アプリ名）\bin\（アプリ名）.exe</p></blockquote>
<p>上記のようなメッセージが表示されます。これでコンパイルは完了です。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://laboratory.kazuuu.net/install-a-web-programming-language-dart-windows-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
