我需要创建类似这样的内容(我正在谈论palceholder的右侧):
我写了下一个代码:
Card(
child: Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Placeholder(
fallbackHeight: 100,
fallbackWidth: 100,
),
Container(
padding: EdgeInsets.only(left: 8, right: 8),
child: Column(
children: <Widget>[
SizedBox(
child: Text("Header"),
),
Flexible(child: Text("Body"), flex: 2),
Text("Footer"),
]
),
),
],
),
)
);
答案 0 :(得分:1)
//更新
@override
Widget build(BuildContext context) {
double _deviceHeight = MediaQuery.of(context).size.height;
return ListView.builder(
itemCount: filmListList.length,
itemBuilder: (BuildContext context, int index) {
return Container(
height: _deviceHeight,
child: Card(
child: Column(
children: <Widget>[
Flexible(
flex: 1,
child: Container(
color: Colors.red,
),
),
Flexible(
flex: 8,
child: Container(
color: Colors.yellow,
),
),
Flexible(
flex: 1,
child: Container(
color: Colors.green,
),
),
],
),
),
);
},
);
}