首页 > 解决方案 > 如何在 Appbar 使用安全区?

问题描述

所以我试图制作一个包含图像和文本的应用栏,但是由于我使用了安全区域小部件,所以图像被裁剪了。有人知道解决方案吗?我试过用

底部:假

在安全区域小部件

在此处输入图像描述

这是代码:

 title: SafeArea(
          bottom: false,
          child: Row(
            children: [
              Container(
                height: deviceData.height * 0.05,
                width: deviceData.width * 0.10,
                decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(100),
                    image: DecorationImage(
                        image: NetworkImage(
                          "https://cdn.popbela.com/content-images/post/20190314/cover-526b71db133e78000df9ead475e858f1_750x500.png",
                        ),
                        fit: BoxFit.cover)),
              ),
              SizedBox(width: 10),
              Container(
                height: deviceData.height * 0.05,
                width: deviceData.width * 0.3,
                child: Text("Nadine Amizah",
                    style: GoogleFonts.poppins(
                        color: Colors.black,
                        fontSize: 15,
                        fontWeight: FontWeight.w500)),
              )
            ],
          ),
        )),

标签: flutter

解决方案


我通过在应用栏使用工具栏高度找到了解决方案


推荐阅读