gpt4 book ai didi

Flutter 卡片形状

转载 作者:IT王子 更新时间:2023-10-29 07:06:45 28 4
gpt4 key购买 nike

我正在使用 flutter gallery 作为示例构建自己的卡片,但是在设置形状时它说参数形状未定义。我不确定这是怎么可能的,因为我认为印象形状是 Card 类的默认属性?如果这是一个 super 简单的修复,我很抱歉。我已经搞砸了几天了。

final ShapeBorder shape;

@override
Widget build(BuildContext context) {
return new SafeArea(
top: false,
bottom: false,
child: new Container(
padding: const EdgeInsets.all(8.0),
height: height,
child: new Card(
elevation: 8.0,
color: const Color(0xFFf0e7d1),
shape: shape, // The first shape is not defined, second is fine?
child: new Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
new SizedBox(
height: 154.0,
child: new Stack(
children: <Widget>[
new Positioned.fill(
child: new Image.asset(
destination.assetName,
fit: BoxFit.cover,
),
),
new Positioned(
bottom: 16.0,
left: 16.0,
right: 16.0,
child: new FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: new Text(
destination.title
),
),
),
],
),
),

最佳答案

好吧,事实证明你实际上根本不需要尺寸实现,所以我只是删除了它,一切都很好!

关于Flutter 卡片形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50492176/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com