Flutter 自定义 SliverAppBar

问题描述

我想了解是否有办法让 Flutter 中的认 sliver 应用栏看起来更像我在网上找到的这种设计。

enter image description here

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 (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...