2
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 1 year has passed since last update.

Arch Linux に Flutter をインストール

Last updated at Posted at 2023-07-18

Flutter のインストール

yay flutter

Flutter のチェック

flutter doctor

メッセージにしたがい次のことを行いました。

sudo pacman -S cmake
sudo pacman -S dart
git config --global --add safe.directory /opt/flutter

android-sdk のインストール

yay android-sdk

設定

flutter config --android-sdk /opt/android-sdk

android-studio のインストール

yay android-studio

環境の設定

.profile
(省略)
#
PATH="/opt/flutter/bin:$PATH"
#
export CHROME_EXECUTABLE=/opt/google/chrome/chrome

Unable to find bundled Java version への対応

cd /opt/android-studio
sudo ln -s jbr jre

最終的な診断結果

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.6, on Arch Linux 6.4.3-arch1-2, locale
    C.UTF-8)
[✗] Android toolchain - develop for Android devices
    ✗ ANDROID_HOME = /opt/android-sdk
      but Android SDK not found at this location.
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2022.2)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 1 category.

ソフトの作成

flutter create myapp
cd myapp

Linux アプリとして動かす

flutter run

image.png

Web サーバーとして動かす

flutter run -d web-server
$ flutter run -d web-server
Launching lib/main.dart on Web Server in debug mode...
Waiting for connection from debug service on Web Server...         16.5s
lib/main.dart is being served at http://localhost:41453
The web-server device requires the Dart Debug Chrome extension for debugging.
Consider using the Chrome or Edge devices for an improved development workflow.

🔥  To hot restart changes while running, press "r" or "R".
For a more detailed help message, press "h". To quit, press "q".

ブラウザーで http://localhost:41453 にアクセス

image.png

参考ページ

Ubuntu で Flutter を使う
Ubuntu で Flutter を使う (その2)

2
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
2
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?