升級到 Flutter 2.8 ...... 這次非常順利

紅寶鐵軌客
Join to follow...
Follow/Unfollow Writer: 紅寶鐵軌客
By following, you’ll receive notifications when this author publishes new articles.
Don't wait! Sign up to follow this writer.
WriterShelf is a privacy-oriented writing platform. Unleash the power of your voice. It's free!
Sign up. Join WriterShelf now! Already a member. Login to WriterShelf.
寫程式中、折磨中、享受中 ......
241   0  
·
2021/12/14
·
3 mins read


前幾天,也就是 2021 年 12 月 9 號,Flutter 又宣布有新的 2.8 版了,距離我上次 10 月更新到 2.5 版失敗,也不過才兩個月,話說,Flutter 改版也太快了吧,不過也好啦,這代表 Flutter 團隊有認真在開發,大家也有認真在用、認真回報錯誤。所以我目前還是 2.2.3 版,好像有點落差了,那就更新吧!

升級到 2.8 版

升級很簡單:

  1. 進到 terminal,
  2. CD 到 Flutter 的目錄,不是 Project 目錄,
  3. 執行 $flutter upgrade 

馬上就可以看到 Upgrading Flutter to 2.8.0 from 2.2.3 in XXXX 的升級訊息出現,然後就是下載~~~~ 跟,等等等⋯⋯ 等它跑完,還好它很快,我的慢網路也不過就 20 分鐘,它跑完了後會自動執行 Flutter doctor,一切都顯示正常,很好,好的開始!

測試

我當然不相信它,我把 iOS / Android / Web 都測試了一下,甚至連真實的機器都連上來測一下,關機重開後再測一次,這很重要,上次就是一重開就不能用了,哇哈,不錯,全部都正常,這次升級很棒,完全無痛。

 

2.8 版的差異
  • 執行速度:這真的很有感,有快很多,
  • App 啟動時間:宣稱可以快 10~50%,我還沒放到 Google Play,不知道。
  • 記憶體:宣稱可以省 10%。
  • DevTools:有新的 Android profiling 功能!
  • Google Mobile Ads 正式上線,剛好,我們很快就會要用到它了。
  • WebView:3.0,可以在 web 上面用 webview 了(webview_flutter_web)。
  • 很多新的 flutter package 拿到 Favorites,它們看起來真的都很酷,我喜歡。
  • FlutterFire,就是 Flutter 使用的 firebase 套件啦:
    • 都從 beta 進步到正式版了⋯⋯ 希望能更穩定了;
    • 它現在有一個新的 CLI, Command Line tool,可以用來設定 FireBase,看來以後設定 FireBase 可以簡單一些,還記得設定 Firebase 有多麻煩嗎!我們有一篇專文在講怎麼設定它呢。
    • 可以直接在 App 裏面設定 Firebase Option 了,例如:apiKey/Id ⋯⋯
    • DartPad 也可以用 FlutterFire 了。
    • 新的 FlutterFire UI:
      • 可以讓你開發登入畫面更簡單,直接史用 Google 及 email Login!
      • 多了一個 FirestoreListViewFirestoreDataTable 可以直接在 Flutter 裡 query 跟 CRUD (新增、讀取、修改、刪除)Firestore 了。
    • Firestore Object/Document Mapping alpha 版公開了,不過還是 alpha,先等等再用吧,這個功能未來因該會很有趣。
  • Desktop 版更穩定了,只是還不是穩定版。
  • Channel dev 取消,這對我完全沒差,我不喜歡用開發中的版本。

 

結論/感覺

變快了很有感,這很不錯,記憶體好像用得少了些,這我沒數字,不過 Android 模擬器以前超級慢,現在有好一點,好像跟記憶體的用量有關。

就跟我上次升級到 2.5 的時候所說,升級都是憂喜摻半,還好這次很不錯,只花了半天就搞定,也不需要做 migration 搬遷,finger cross,希望接下來也一切順利。

完整的官方 2.8 版說明在這裡

 

 




WriterShelf™ is a unique multiple pen name blogging and forum platform. Protect relationships and your privacy. Take your writing in new directions. ** Join WriterShelf**
WriterShelf™ is an open writing platform. The views, information and opinions in this article are those of the author.


Article info

This article is part of:
Categories:
Tags:
Total: 760 words


Share this article:
About the Author

很久以前就是個「寫程式的」,其實,什麼程式都不熟⋯⋯
就,這會一點點,那會一點點⋯⋯




Join the discussion now!
Don't wait! Sign up to join the discussion.
WriterShelf is a privacy-oriented writing platform. Unleash the power of your voice. It's free!
Sign up. Join WriterShelf now! Already a member. Login to WriterShelf.