我正在尝试像下面的图片那样在抖动中进行特殊设计:
下面的代码给我这个:
return Container(
width: 100.0,
child: Card(
color: Colors.white,
child: Wrap(
children: <Widget>[
SizedBox(
height: 140.0,
width: 100.0,
child: Image(
image: NetworkImage(image_large +
snapshot.data.results[index]
.posterPath),
fit: BoxFit.cover,
),
),
Padding(
padding: const EdgeInsets.all(4.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Text(
_getTrendingTitle(
snapshot, index),
textAlign: TextAlign.left,
maxLines: 2,
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.bold),
),
Divider(
height: 1,
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: <Widget>[
_getExactRating(snapshot
.data
.results[index]
.voteAverage),
Text(
' ' +
snapshot
.data
.results[index]
.voteAverage
.toString(),
textAlign: TextAlign.left,
maxLines: 2,
style: TextStyle(
fontSize: 10,
fontWeight:
FontWeight.normal,
color: Colors.black87,
),
),
Text(' | '),
_getExactVotes(snapshot
.data
.results[index]
.voteCount),
Text(
_getExactVotesNumber(
snapshot
.data
.results[index]
.voteCount),
textAlign: TextAlign.left,
maxLines: 2,
style: TextStyle(
fontSize: 10,
color: Colors.black87,
fontWeight: FontWeight
.normal))
])
],
),
)
],
)));
将Wrap
小部件更改为Column
小部件,并像这样提供mainAxisAligment
Column(
children: [
Expanded(
child: Column(
children: // all other widgets
)
),
Row()
]
)
这将使它们按照您需要的方式对齐