---
# System prepended metadata

title: 『Flutter』TextField焦點取消並收起鍵盤
tags: [Flutter]

---

# 『Flutter』TextField焦點取消並收起鍵盤
###### tags: `Flutter`

GestureDetector 手勢偵測
FocusScope 轉移焦點
資料放入child

```=
GestureDetector(
    behavior: HitTestBehavior.translucent,
    onTap: () {
        // 触摸收起键盘
        FocusScope.of(context).requestFocus(FocusNode());
    },
    child: ....
}
```