【问题标题】:Flutter BottomNavigationBar Border?Flutter BottomNavigationBar 边框?
【发布时间】:2020-07-29 00:06:42
【问题描述】:

我想让 BottomNavigationBar 的阴影更暗更明显。我通常通过添加边框来做到这一点,但我现在不能这样做。感谢您的帮助!

【问题讨论】:

  • 请分享您的代码,让我们知道您到目前为止所做的尝试

标签: flutter


【解决方案1】:

这是给BottomNavigationBar添加边框的方法

() => showModalBottomSheet(
            context: context,
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(30),
              side: BorderSide(color: Colors.black, width: 2.0),
            ),
            builder: (context) => Container(
              decoration: BoxDecoration(
                boxShadow: [
                  BoxShadow(
                    color: Colors.black,
                    blurRadius: 20.0, // has the effect of softening the shadow
                    spreadRadius: 5.0, // has the effect of extending the shadow
                    offset: Offset(
                      10.0, // horizontal, move right 10
                      10.0, // vertical, move down 10
                    ),
                  )
                ],
              ),
            ),
          ),

还可以看看 box shadow 这可能有你想要的效果

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-28
    • 1970-01-01
    • 2020-03-11
    • 1970-01-01
    • 2020-09-11
    • 2021-06-18
    • 1970-01-01
    • 2022-11-18
    相关资源
    最近更新 更多