2020/8/26

flutter : 竟然支援 desktop 了 -- linux. gtk

ref: 跟 support web 一樣,flutter config --enable-linux-desktop
測試過,要 branch dev 才有,beta 的話 enable OK,但是不會真的 create linux folder(device)
enable 完,upgrade 後,run doctor 有 Error...
[✗] Linux toolchain - develop for Linux desktop
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
    ✗ ninja is required for Linux development.
      It is likely available from your distribution (e.g.: apt install ninja-build), or can be downloaded from https://github.com/ninja-build/ninja/releases
    ✗ GTK 3.0 development libraries are required for Linux development.
      They are likely available from your distribution (e.g.: apt install libgtk-3-dev)
    ✗ The blkid development library is required for Linux development.
      It is likely available from your distribution (e.g.: apt install libblkid-dev)
就 follow instruction...
apt install clang ninja-build libgtk-3-dev libblkid-dev
然後舊真的可以 run 了...

最後要 build release 的話,就在 project 下
flutter build linux
要記得,flutter app 包含很多 library,所以要執行 release/bundle/ 下的執行檔,而不是 release 下的
目前支援 linux 跟 macos (是,windows 沒有)

更正:
ref:flutter and desktop

所以是有support windows 的,只是還在更初期階段,master branch
一樣,flutter channel master, upgradeconfig --enable-windows-desktop

之後到舊project 去 flutter create . 一下,再 flutter run -d windows 舊可以。

最後在 windows folder 下會有 visual studio 的 sln 檔。似乎可以用 visual studio 打開。
flutter doctor 可以看到有檢查 Visual Studio 有沒有安裝。
-- 我有安裝 community 版

沒有留言:

張貼留言