【发布时间】:2020-01-23 06:55:28
【问题描述】:
我正在尝试设置卡片的高度和宽度,如下所示,但它返回错误:高度和宽度均未定义“命名参数”。这是设置卡片高度和宽度的错误方法吗?
小部件构建(BuildContext 上下文){ 最终 ThemeData 主题 = Theme.of(context);
return new WillPopScope(
onWillPop: () => _onBackPressed(context),
child: Scaffold(
appBar: new AppBar(
title: new Text(
'Finding your pizza',
style: theme.textTheme.title,
),
),
body: new Card(
width: MediaQuery.of(context).size.width/60,
height: MediaQuery.of(context).size.height/60,
child: new Center(
child: new Column(
children: <Widget>[
【问题讨论】:
-
您可以将 Card 用作 Container 的子级并为该 Container 设置宽度、高度