【发布时间】:2021-06-15 14:59:39
【问题描述】:
showDialog(
context: context,
barrierDismissible: false,
child: AlertDialog( // this line error
shape: defaultCardBorder(),
title: Row(
children: [
_icon,
SizedBox(width: 10),
Expanded(child: Text(_title, style: TextStyle(fontSize: 22)))
],
),
content: Text(
message,
style: TextStyle(fontSize: 18),
),
actions: [
/// Negative button
negativeAction == null
? Container(width: 0, height: 0)
: FlatButton(
onPressed: negativeAction,
child: Text(negativeText ?? "CANCEL",
style: TextStyle(fontSize: 18, color: Colors.grey))),
/// Positive button
FlatButton(
onPressed: positiveAction ?? () => Navigator.of(context).pop(),
child: Text(positiveText ?? "OK",
style: _textStyle)),
],
));
>如何在flutter中解决这个问题 子行错误。错误是未定义命名参数“child”。 未定义命名参数“child”。 尝试将名称更正为现有命名参数的名称,或使用
定义命名参数【问题讨论】:
标签: flutter