我正在寻找一种在卡的底部设置小部件的方法,我不知道这是否是我必须使用的小部件,但是,我拥有的代码如下:
Widget build(BuildContext context) {
return GridView.count(
primary: true,
padding: const EdgeInsets.all(20.0),
crossAxisSpacing: 1.0,
childAspectRatio: 1.5,
crossAxisCount: 1,
children: <Widget>[
Card(
child: new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
leading: const Icon(Icons.album),
title: const Text('The Enchanted Nightingale'),
subtitle: const Text('Music by Julie Gable. Lyrics by Sidney Stein.'),
),
new ButtonTheme.bar( // make buttons use the appropriate styles for cards
child: new ButtonBar(
children: <Widget>[
new FlatButton(
child: const Text('BUY TICKETS'),
onPressed: () { /* ... */ },
),
new FlatButton(
child: const Text('LISTEN'),
onPressed: () { /* ... */ },
),
],
),
),
],
),
)
]
);
}
因此,我想添加类似于底部的内容:Text(“我是底部”)
答案 0 :(得分:1)
您可以使用Expanded
小部件来包装ListTile
@override
Widget build(BuildContext context) {
return Center(
child: Container(
child: GridView.count(
primary: true,
padding: const EdgeInsets.all(20.0),
crossAxisSpacing: 1.0,
childAspectRatio: 1.5,
crossAxisCount: 1,
children: <Widget>[
Card(
child: new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Expanded(
child: const ListTile(
leading: const Icon(Icons.album),
title: const Text('The Enchanted Nightingale'),
subtitle: const Text(
'Music by Julie Gable. Lyrics by Sidney Stein.'),
),
),
Container(
color: Colors.blue,
child: new ButtonBar(
children: <Widget>[
new FlatButton(
child: const Text('BUY TICKETS'),
onPressed: () {/* ... */},
),
new FlatButton(
child: const Text('LISTEN'),
onPressed: () {/* ... */},
),
],
),
)
],
),
)
])));
我只是添加了具有自定义颜色的容器以查看底部。
答案 1 :(得分:0)
我得到了解决方案,使用了脚手架并使用了自己的bottomNavigationBar。
twitter_stream.filter