首页 > 解决方案 > 删除 SliverAppBar 底部边框 - Flutter

问题描述

在此处输入图像描述

我想删除我在上图中突出显示的边框。我找不到任何解决方案来解决这个问题:(

这是我的 SliverAppBar 代码:

NestedScrollView(
        headerSliverBuilder: (BuildContext ctx, isScrolled) {
            return <Widget>[
               SliverAppBar(
                  title: Text('Applying to this job opportunity'),
                  pinned: true,
                  titleSpacing: 0,
                  floating: true,
                  expandedHeight: 180,
                  flexibleSpace: //some widgets
             )
        ]
    }
)

标签: flutterdartflutter-layout

解决方案


只需将elevation属性设置为0.

 SliverAppBar(
                  title: Text('Applying to this job opportunity'),
                  pinned: true,
                  elevation: 0,
                  titleSpacing: 0,
                  floating: true,
                  expandedHeight: 180,
                  flexibleSpace: //some widgets
             )

更多信息:https ://api.flutter.dev/flutter/material/SliverAppBar/elevation.html


推荐阅读