【发布时间】:2021-01-12 19:33:47
【问题描述】:
Provider.of<Products>(context, listen: false)
.addProducts(_editedProduct)
.catchError((error) {
return showDialog<Null>(
context: context,
builder: (ctx) {
return AlertDialog(
title: Text(
'An error occurred',
),
content: Text('SomethingWent Wrong'),
actions: [
FlatButton(
child: Row(
children: [
Icon(Icons.close),
Text('Close'),
],
),
onPressed: () {
Navigator.of(context).pop();
},
)
],
);
},
);
}).then((value) {
setState(() {
_isLoading = false;
});
Navigator.of(context).pop();
});
我能够显示警告对话框,但我无法显示标题。我找不到原因。 一切正常,只是没有显示标题。
【问题讨论】:
-
你的主题的标题颜色是白色的吗?只是为了确保:尝试设置标题的颜色(例如黑色)。
-
谢谢。是的,这是我的主题配置的问题。
标签: flutter flutter-widget flutter-dialog