Flutter Dialog弹窗内容区域存在TextField,当Keyboard显示时点击空白区域隐藏
keyboard
同时 不 dismissDialog
.
return GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
// print('>>> 点击了 ' + DateTime.now().millisecondsSinceEpoch.toString());
FocusScope.of(context).requestFocus(FocusNode());
},
child: UnconstrainedBox(
child: Padding(
padding:
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: GestureDetector(
onTap: () {},
child: SizedBox(
width: 2 * 300.w,
child: Material(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(4))),
child: dialogChild,
color: Colors.white,
),
),
),
),
),
);