【发布时间】:2019-12-24 04:58:27
【问题描述】:
我正在尝试使用颤振构建一张卡片,看起来像下面显示的概念,但我得到了这个。
这是 Dart 中的卡片小部件代码:
@override
Widget build(BuildContext context) {
return Center(
child: Card(
margin: EdgeInsets.symmetric(horizontal: 14.0),
color: Colors.white,
elevation: 6.0,
child: InkWell(
splashColor: Colors.blue.withAlpha(30),
onLongPress: () {_copy();},
onTap: () {},
child: Container(
child: Padding(
padding: EdgeInsets.all(12.0),
child: Row(
children: <Widget>[
Text(widget.cardTitle),
Spacer(),
ButtonBar(
children: <Widget>[
new IconButton(
icon: Icon(CardsIcons.arrows_ccw, color: primaryDark,),
onPressed: () {_refresh();},
),
new IconButton(
icon: Icon(CardsIcons.heart_empty, color: Colors.redAccent,),
onPressed: () {_bookmark();},
),
],
),
SizedBox(height: 24.0,),
Text(
widget.cardContent,
),
],
),
),
),
),
),
);
}
这是我目前得到的输出
这是所需的输出
【问题讨论】:
标签: mobile flutter dart flutter-layout