0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Flutterの導入(4) ~for Windows10~ Windows で Flutter を扱うときの設定をしよう

Posted at

Windows で Flutter を扱うときの設定をしよう


そんなにいろんなことはしないんだけど。
Windows 上でも Flutter を起動できるテクニカルプレビューがあるようなので、
それで起動するときの設定とやり方を書いておく。

Windows で Flutter ?

Android Studio とか Visual Studio Code で動かすんでもいいんだけどさ。
俺は個人的には Windows でも動かしたいわけなんですよ。
それが出来るなら、3つの環境で動くクロスプラットフォーム環境だし、
ソースコード1個しか書かなくて済むから、とても気楽なんだよね。

Visual Studio 2019 をインストールする

Visual Studio 2019 をインストールする。Visual Studio Community 2019でいい。
ダウンロードして、インストールするだけ。

Visual Studio 2019 で使うものをインストールしておく

以下が必要なようだ。

  • C++ によるデスクトップ開発
    • MSBuild
    • MSVC v142 - VS 2019 C++ x64/x86 ビルドツール
    • Windows 10 SDK (最新)

Visual Studio 2019 を起動して、メニューから「ツール」「ツールと機能を取得」を選択。
Visual Studio Installer が起動するので、
赤枠のところにチェックが入っているようにして、インストールを行う。
image.png

Flutter に Windows を認識してもらう

デフォルトだと Windows 用の機能が無効になっているので有効にしてもらう。

念の為Flutterを更新してから、 --enable-windows-desktop を設定して、
機能を有効にする。

C:\src>flutter channel master
C:\src>flutter upgrade
C:\src>flutter config --enable-windows-desktop

これでOK。この後、デバイスリストを取得すると、
↓こんな感じに Windows をデバイスとして認識できるようになる。

C:\src>flutter devices
1 connected device:

Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.18363.997]

これで Windows 上でも Flutter を使ったアプリが起動できるようになった。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?