【发布时间】:2019-09-10 03:54:45
【问题描述】:
我制作了一个 sliverappbar,我想在这个 sliverappbar 上放一张卡片。如何在 sliverappbar 上放一张卡片,然后这张卡片与 sliverappbar 一起折叠?
卡片应该一半在appbar,一半在'body'
CustomScrollView(
slivers: <Widget>[
SliverAppBar(
expandedHeight: 100.0,
floating: true,
snap: true,
backgroundColor: Colors.green,
elevation: 0.0,
flexibleSpace: FlexibleSpaceBar(
title: const Text(
"test",
style: TextStyle(color: Colors.white, fontSize: 20.0),
),
centerTitle: true,
background: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Stack(
children: <Widget>[
Container(
height: 60.0,
color: Colors.black,
)
],
)
],
)
),
SliverFillRemaining(
child: new Text("data"),
)
],
),
【问题讨论】:
-
已经尝试 Stack 小部件,没有成功