gpt4 book ai didi

dart - 如何将小部件放置在一行包含的卡片中?

转载 作者:IT王子 更新时间:2023-10-29 06:55:08 26 4
gpt4 key购买 nike

目前,我正在尝试创建一个卡片模板以插入到 ListView 中。我希望带有图标按钮的列位于最右侧。我似乎无法找到一种方法来说明包含图标按钮的列需要向右刷新。

new Expanded(
child: new ListView(
shrinkWrap: true,
padding: const EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
children: <Widget>[
new Card(
child: new Row(
children: <Widget>[
new Padding(
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 0.0),
),
new Image(
//image: new AssetImage("assets/ic_access_alarm_red_24dp.png"),
image: new AssetImage("assets/pastDue.png"),
height: 50.0,
width: 50.0,
),
new Padding(
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 0.0),
),
new Column(
children: <Widget>[
new Text("This is the title"),
new Text("This is the Description"),
new Text("This is the date"),
],
),
new Column(
children: <Widget>[
new IconButton(
icon: new Icon(Icons.note_add),
onPressed: () {
select("AddCalibration");
}
),
new IconButton(
icon: new Icon(Icons.edit),
onPressed: () {
select("EditInstrument");
}
)
],
)
],
)
),

const Text("I am"),
const Text("A ListView"),
],
)
)

This is a capture of what it currently looks like.

最佳答案

谢谢你,vbandrade!

这绝对解决了我的问题。

new Expanded(
child: new ListView(
shrinkWrap: true,
padding: const EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
children: <Widget>[
new Card(
child: new ListTile(
leading: new Image(
image: new AssetImage("assets/pastDue.png"),
height: 50.0,
width: 50.0,
),
title: new Column(
children: <Widget>[
new Text("This is the title"),
new Text("This is the Description"),
new Text("This is the date"),
],
),
trailing: new Column(
children: <Widget>[
new IconButton(
icon: new Icon(Icons.note_add),
onPressed: () {
select("AddCalibration");
}),
new IconButton(
icon: new Icon(Icons.edit),
onPressed: () {
select("EditInstrument");
})
],
),
),
),
const Text("I am"),
const Text("A ListView"),
],
))

This is the end result.

关于dart - 如何将小部件放置在一行包含的卡片中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50878254/

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