问题描述
我想了解是否有办法让 Flutter 中的默认 sliver 应用栏看起来更像我在网上找到的这种设计。
PS:我熟悉这样做的默认方式,但在这种情况下使用 Flutter 广泛可定制的小部件似乎是问题所在。
这就是我所做的。似乎无法让底部边缘变圆或实现非默认的条形应用栏行为。
return SafeArea(
child: Scaffold(
body: CustomScrollView(
slivers: [
SliverAppBar(
automaticallyImplyLeading: false,expandedHeight: height * 0.35,pinned: false,floating: true,leading: IconButton(
onpressed: () => Navigator.pop(context),icon: Icon(
Icons.chevron_left,color: Theme.of(context).primaryColor,),flexibleSpace: FlexibleSpaceBar(
background: Container(
decoration: Boxdecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(20.0),bottomright: Radius.circular(20.0))
),child: Stack(
children: [
Image.network(
'https://picsum.photos/200',fit: BoxFit.cover,Container(
width: width,height: height * 0.35,color: Colors.redAccent,],)
),SliverFillRemaining(
child: Column(
children: List<int>.generate(6,(index) => index)
.map((index) => Container(
height: 40,margin: EdgeInsets.symmetric(vertical: 10),color: Colors.grey[300],alignment: Alignment.center,child: Text('$index item'),))
.toList(),)
],);
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)