Section 4: Widgets, Styling, Adding Logic – Building a Real App

Tagged: , , , ,

  • Section 4: Widgets, Styling, Adding Logic – Building a Real App

     BBB updated 5 months ago 4 Members · 94 Posts
  • SSS

    Member
    2021/01/16 at 10:39

    預留給之後討論記錄用

  • SSS

    Member
    2021/01/16 at 10:40

    pdf 圖表不錯,有助於記憶各Widget適用型態。

    • SSS

      Member
      2021/01/16 at 10:40

      PS: An Overview of the Core Flutter Widgets 中提到的pdf

    • SSS

      Member
      2021/01/16 at 10:40

      這個也不錯:

      rows-columns-cheat-sheet.pdf

  • CCC

    Member
    2021/01/16 at 10:43

    PDF 整理的很棒 我也喜歡

  • OOO

    Member
    2021/01/16 at 10:43

    這邊看的太快,覺得 transaction list 不太懂

  • BBB

    Member
    2021/01/16 at 10:44

    其實如果畫了widget tree, 就可以明白

    • OOO

      Member
      2021/01/16 at 10:46

    • BBB

      Member
      2021/01/16 at 10:48

      而且可以幫你決定什麼時候用stateful 和state less

    • SSS

      Member
      2021/01/16 at 10:50

      我記得Android Studio 右側邊欄,有類似的工具。VSCode有嗎?

      • BBB

        Member
        2021/01/16 at 10:51

        Dev tool

        • SSS

          Member
          2021/01/16 at 10:52

          感謝。

          可能我漏了,只記到這幾個:

          • Debug Paint

          • Performance Delay

          • Debug Banner

          • Repaint Rainbow

    • SSS

      Member
      2021/01/16 at 10:52

      我喜歡這個建議:其實如果畫了widget tree, 就可以明白

  • OOO

    Member
    2021/01/16 at 10:48

    現在都只有上都沒跟著做 orz

  • CCC

    Member
    2021/01/16 at 10:54

    沒跟著寫 真的會有點難懂

    1. 他講得快

    2. transactionList, transaction_item, new_transaction, user_transaction 我覺得就會混亂

    3. 他跟 angela 一樣會隨時重構,然後就更亂了

  • OOO

    Member
    2021/01/16 at 10:54

    Angela 重構比較好理解

  • SSS

    Member
    2021/01/16 at 10:54

    我這週比上週好多了

    • SSS

      Member
      2021/01/16 at 10:55

      不曉得是聲音正常,還是習慣他的口音了

  • BBB

    Member
    2021/01/16 at 10:55

    User transaction是parent

  • BBB

    Member
    2021/01/16 at 10:56

    內有new transaction和transaction list

  • CCC

    Member
    2021/01/16 at 10:56

    max 用很多 dart 語法技巧,我也還在消化

  • BBB

    Member
    2021/01/16 at 10:57

    說起來, dart有一個功能叫extension, 我等下再分享

    • CCC

      Member
      2021/01/16 at 11:01

      … 嗎

  • BBB

    Member
    2021/01/16 at 10:57

    他這一張就教 lifting up state

  • SSS

    Member
    2021/01/16 at 10:58

    • pass the pointer

    if we would add parentheses, we would immediately execute this when Dart parses this line, without parentheses we just pass down the pointer.

  • BBB

    Member
    2021/01/16 at 10:59

    感覺上沒上angela 的堂, 大約不會明白做什麼

  • SSS

    Member
    2021/01/16 at 10:59

    那我們運氣不錯

  • CCC

    Member
    2021/01/16 at 11:03

    分享一個我 debug 很久的小地方 😭 callback 觀念錯誤導致…

    // 錯錯錯,觀念不清...
    FlatButton(
    onPressed: addTransactionCallbackHandler(
    ooxx55661qaz...
    ),
    // 正確
    FlatButton(
    onPressed: () => addTransactionCallbackHandler(
    ooxx55661qaz...
    ),
  • CCC

    Member
    2021/01/16 at 11:04

    TextField 以前好像沒有用 controller 去監聽操控

    final TextEditingController titleController = TextEditingController();
    TextField( controller: titleController,
    ...
  • BBB

    Member
    2021/01/16 at 11:05

    第一次見這個controller, 感覺比onchange方法好

  • OOO

    Member
    2021/01/16 at 11:06

    我覺得沒有用是做法的問題

    應該跟每個人習慣有關

  • CCC

    Member
    2021/01/16 at 11:06

    controller, builder 是一種 pattern 設計嗎?

  • BBB

    Member
    2021/01/16 at 11:08

    是, 但不知道是什麼design pattern

  • CCC

    Member
    2021/01/16 at 11:09

    angela 的全域變數 區域變數 儲存確實比較好理解

  • CCC

    Member
    2021/01/16 at 11:09

    所以我在猜這種 xxxx er 大概是為了效能還是什麼創造設計出來的

  • OOO

    Member
    2021/01/16 at 11:10

    builder 應該是 factory pattern

  • OOO

    Member
    2021/01/16 at 11:10

    controller 不確定是不是本身就算是一種

  • CCC

    Member
    2021/01/16 at 11:11
  • CCC

    Member
    2021/01/16 at 11:13

    我不很理解就是 XD

  • SSS

    Member
    2021/01/16 at 11:13

    沒有看這個

  • CCC

    Member
    2021/01/16 at 11:14

    課程老師用很多 list iterator 用法: map, generate, fold, where, removeWhere,

  • CCC

    Member
    2021/01/16 at 11:14

    有的東西我都是 for in 硬幹,老師講了才知道有這種方法可以用,可以偷懶 XD

  • BBB

    Member
    2021/01/16 at 11:15

    Fold和reduce一樣, 但可以用在empty list

  • BBB

    Member
    2021/01/16 at 11:16

    Reduce不能用在empty collection

  • CCC

    Member
    2021/01/16 at 11:16

    立刻筆記

  • CCC

    Member
    2021/01/16 at 11:19

    然後這章在學習了一個 stack widget 用法用法

    // children 越上面越底層
    Stack(
    children: <Widget>[
    Container(
    decoration: BoxDecoration(
    border: Border.all( color: …
  • CCC

    Member
    2021/01/16 at 11:19

    chart 跟 bar 的部分我也卡很久…

  • BBB

    Member
    2021/01/16 at 11:19

    JavaScript ES6, C++17等等都加上了 這些function

  • BBB

    Member
    2021/01/16 at 11:20

    Map, filter, reduce

    一定要學會用這3個

  • CCC

    Member
    2021/01/16 at 11:20

    好的 謝謝你

    明天找時間特別看這三個

  • CCC

    Member
    2021/01/16 at 11:21

    for in 硬幹很麻煩的 XD

  • SSS

    Member
    2021/01/16 at 11:21

    @BBB 你所有程式都這麼熟啊?

    • BBB

      Member
      2021/01/16 at 11:22

      都學一點

    • SSS

      Member
      2021/01/16 at 11:22

      太厲害了

    • BBB

      Member
      2021/01/16 at 11:23

      主要讀書時學OS, 大約最難的了

    • SSS

      Member
      2021/01/16 at 11:23

      OS我連想都不敢想

    • OOO

      Member
      2021/01/16 at 11:24

      太強了

    • BBB

      Member
      2021/01/16 at 11:25

      結果沒什麼用

      😂 😂 😂

    • SSS

      Member
      2021/01/16 at 11:25

      也許你其實已經用在各種程式設計中了

    • OOO

      Member
      2021/01/16 at 11:26

      怎麼會沒用,就用在指導我們上

    • SSS

      Member
      2021/01/16 at 11:26

      排程啊什麼的

  • CCC

    Member
    2021/01/16 at 11:29

    future 這個 angela 就沒講到了,很實用

    //  Future 有一個 then Function 可用,代表 Future 回傳後的效果
    ​showDatePicker(
    context: context,
    initialDate: DateTime.now(),
    firstDate: DateTime(2020),
    lastDate: DateTime.now(),
    ).then((value) {
    setState(() {
    date = value;
    });
    });
  • BBB

    Member
    2021/01/16 at 11:29

    因為有了asyn 和 await

  • OOO

    Member
    2021/01/16 at 11:29

    asyn await 我也是後來改用 kotlin 加 coroutin 才慢慢有點了解

  • OOO

    Member
    2021/01/16 at 11:30

    但目前也只能算會用而已

  • CCC

    Member
    2021/01/16 at 11:30

    這是語言改版 先後支援的部分?

  • BBB

    Member
    2021/01/16 at 11:31

    then 是最初給JavaScripts用的

  • BBB

    Member
    2021/01/16 at 11:31

    最先是用callback, 然後發現一堆問題

  • CCC

    Member
    2021/01/16 at 11:31

    嗯嗯 我也有 google JavaScripts 也有支援 async await

  • BBB

    Member
    2021/01/16 at 11:31

    然後出現promise和.then

  • BBB

    Member
    2021/01/16 at 11:32

    現在是async await

  • CCC

    Member
    2021/01/16 at 11:32

    都是解決一樣的問題嗎

  • BBB

    Member
    2021/01/16 at 11:32

  • CCC

    Member
    2021/01/16 at 11:33

    那為什麼這麼多寫法 或者有推薦哪一種寫法嗎

  • BBB

    Member
    2021/01/16 at 11:33

    主要是asynchronous programming, 你要等你的data

  • BBB

    Member
    2021/01/16 at 11:33

    Async await

  • CCC

    Member
    2021/01/16 at 11:33

    ok

  • BBB

    Member
    2021/01/16 at 11:34

    因為比較像我們平時的語法

  • BBB

    Member
    2021/01/16 at 11:34

    你去找callback hell就會明白

  • OOO

    Member
    2021/01/16 at 11:35

    總之寫法很多

  • OOO

    Member
    2021/01/16 at 11:35

    但最終是要找個有效且好寫的做法

  • OOO

    Member
    2021/01/16 at 11:35

    寫是一回事,維護也是一回事

  • CCC

    Member
    2021/01/16 at 11:35

    不過 flutter 最討厭的就是一堆 )))))))

  • CCC

    Member
    2021/01/16 at 11:35

    寫 .then 我大概也看到眼睛花了…

  • CCC

    Member
    2021/01/16 at 11:36

    我大概就到這邊

  • OOO

    Member
    2021/01/16 at 11:36

    我可能要再重看一遍

  • CCC

    Member
    2021/01/16 at 11:36

    這章下去做很花時間 很有得消化

  • SSS

    Member
    2021/01/16 at 11:36

    我好幾節也標註要重看

  • CCC

    Member
    2021/01/16 at 11:37

    @BBB 說起來, dart有一個功能叫extension, 我等下再分享

  • BBB

    Member
    2021/01/16 at 11:37
  • OOO

    Member
    2021/01/16 at 11:38

    ok 我看開頭大概就知道了

  • OOO

    Member
    2021/01/16 at 11:38

    kotlin有一樣的

  • CCC

    Member
    2021/01/16 at 11:38

    這我沒 google 到 感謝分享

  • BBB

    Member
    2021/01/16 at 11:38

    可以clean your code

Log in to reply.

Original Post
0 of 0 posts June 2018
Now