showMenu(
context: context,
position: RelativeRect.fromLTRB(5000, appBar.preferredSize.height + statusBarHeight!, 0.0, 0.0),
items: [
PopupMenuItem(
child: Text('Cancel'),
value: 0,
onTap: () {
cancelDialog();
},
),
],
);
Run Code Online (Sandbox Code Playgroud)
cancelDialog() {
return () {
showDialog(
context: context,
builder: (BuildContext context) => OrderCancel(order!.orderId!),
);
};
}
Run Code Online (Sandbox Code Playgroud)
使用以前的代码无法打开cancelDialog 。但它可以通过单击另一个按钮正确打开
当我在我的应用程序上做自定义 Toast 时,我注意到 setView 已被弃用。
有没有人对此有解决方案?
toast.setView(customView);
Run Code Online (Sandbox Code Playgroud)