想在图片上头像部分浮动 ,头像有如下列表或内容,下拉时不要拉伸
CustomScrollView
slivers
SliverAppBar
flexibleSpace
background: Image
SliverList
CircleAvatar
CustomScrollView(
physics: const AlwaysScrollableScrollPhysics(),
slivers: <Widget>[
SliverAppBar(
floating: true,
pinned: true,
expandedHeight: 120.0,
stretch: true,
stretchTriggerOffset: 150.0,
flexibleSpace: FlexibleSpaceBar(
background: Image.network(indexData.banner, fit: BoxFit.cover,),
),
),
SliverList(
delegate: new SliverChildBuilderDelegate((BuildContext context, int index) {
return Column(
children: <Widget>[
Row(
children: <Widget>[
Container(
width: 95,
height: 95,
margin: EdgeInsets.only(left: 16),
child: CircleAvatar(
backgroundImage: NetworkImage(indexData.avatar),
radius: 42.5,
),
decoration: new BoxDecoration(
border: new Border.all(width: 5.0, color: blackLight),
borderRadius: new BorderRadius.all(new Radius.circular(42.5)),
color: blackLight
),
)
],
)
] ,
);
}, childCount: 1 ),
),
],
)
slivers使用Stack:RenderViewport 需要一个 RenderSliver 类型的子级,但收到了一个 RenderStack 类型的子级。
为什么只有SliverList、SliverFixedExtentList、SliverGrid、SliverPadding、SliverAppBar...可以在slivers中使用?