Flutter Monthly #2019/10

Flutter Taipei
Flutter Taipei
Published in
5 min readFeb 25, 2020

除了簡介 Widget,在線下活動 Flutter Brunch 本月講師 Chloe 用 Draggable 和 DragTarget 做了一個很可愛的連連看 Sample,邀請大家一同練習!

Flutter Video

ListTile:
快速製作符合 Material Design 的 ListView item 幫手。如果遇到類似 ListTile 的介面設計,便不需要自己另外設計一個 Widget。

Widget of the week — ListTile on Flutter YouTube channel

Container:
Container 應該是學 Flutter 最基礎的 Widget 了,可以為 child widget 做不同的設置,包括 style, shape, size, position, etc.

Widget of the week — Container on Flutter YouTube channel

SelectableText:
可以選取文字的 Text Widget,可自訂選取範圍、選取動作設定。

Widget of the week — SelectableText on Flutter YouTube channel

精選文章介紹

  • Flutter Internationalization the Easy Way — using Provider and JSON
    自行編寫 i18n 的 JSON 檔,不必做 intl 編譯文件。
  • Building a Responsive UI Architecture in Flutter
    在同一個 App 支援不同裝置/螢幕大小時,程式架構的建立參考。
  • Building Flutter apps with WordPress Backend — Part 1
    博客主有福了!結合 WordPress 內容產出自己的部落格 App。文章持續更新中,歡迎有興趣的人和作者互動。
  • Android Dark Theme in Flutter
    Flutter 如何實作黑暗模式?只要在 MaterialApp 的 theme 增加 darkTheme 設定即可。

Flutter 練習

Draggable

Draggable 可以幫助我們處理物件的移動,當物件從靜止 ( child ) 經過操作者拖曳而移動的過程中,我們可以理解成是有個影子 ( feedback ) 從原始物件脫離出來,而製造出移動中的物體。移動本身可以是隨意的,也可以限制它的範圍。

Widget of the Week — Draggable on Flutter YouTube channel

DragTarget

DragTarget 將 Widget 包裝成 Draggable 的目的地。和 Draggable 合併使用,可以處裡物件拖曳到指定位置的事件。這兩者連結的依據是 Draggable 所帶的 data,會由 DragTarget 的 onWillAccept 所接收,根據 data 判斷兩者是否匹配。

範例

資料參考

--

--