我将幻灯片菜单中的屏幕推为:
Navigator.of(context).pushReplacementNamed(AskQueriesScreen.routeName);
现在,当我尝试使用Rest Api时:
final products = Provider.of<Products>(context);
setState(() {
isLoading = true;
});
products.submitQuery(Product(
id:'',
title: _titleController.text,
imageUrl: '',
description: '',
createdat: DateTime.now(),
isFavorite: false
)
).then((result){
setState(() {
isLoading = false;
});
print(result);
Alert(
context: context,
type: result == 'success' ? AlertType.success : AlertType.error,
title: result.toUpperCase(),
desc: "We Will Back To You Soon.",
buttons: [
DialogButton(
child: Text(
"Ok",
style: TextStyle(color: Colors.white, fontSize: 20),
),
onPressed: () => {Navigator.pop(context)},
width: 120,
)
],
).show();
});
一旦我点击“确定”,我将无法使用从屏幕上删除弹出窗口
Navigator.pop(context)
任何帮助将不胜感激,