Closed MrDgbot closed 2 years ago
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
//页面渲染完成
});
- initState里面做界面操作,必须要等当前页面渲染完成
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { //页面渲染完成 });
将监听放入后 同样存在此问题 代码如下
你传个能复现问题的最简demo吧
I get the error after after focusing on a textfield before calling SmartDialog.show. The fix for me was to open a popmenu and close immediately before calling SmartDialog.show:
// The below block fixes an overlay bug that
// occurs when a textfield is focused before SmartDialog.show is triggered:
// In other to fix the issue, I open up a popup menu and close immediately
// before calling SmartDialog.show:
showMenu(
context: context,
color: transparentColor,
position: RelativeRect.fromLTRB(100, 100, 100, 100),
items: [
PopupMenuItem<String>(child: const SizedBox(), value: 'Nothing'),
],
);
finish(context); // Close popup menu
SmartDialog.show(
backDismiss: false,
clickBgDismissTemp: false,
isLoadingTemp: false,
alignmentTemp: Alignment.centerRight,
tag: tag,
widget: Column(...
初始化了,在initState里面添加监听中showToast报错,