GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
// 触摸收起键盘
FocusScope.of(context).requestFocus(FocusNode());
},
child: ****视图内容***
}
把GestureDetector放在body最外层
原文链接 https://blog.csdn.net/weixin_42869574/article/details/103301302