首页 > 解决方案 > Flutter 小部件不是彼此重叠,而是彼此相邻

问题描述

有没有人我怎么能把Container()旁边的Text()?因为如果我像在当前代码中那样做,那么这两件事是相互重叠的。如果有人知道如何修复此评论,请。

title:Column(
          children: [
            Container(
              margin: EdgeInsets.fromLTRB(0,0,0,0),
              width: 40,
              height: 40,
              decoration: BoxDecoration(
                  border: Border.all(
                      width: 3,
                      color: Theme.of(context).scaffoldBackgroundColor
                  ),
                  boxShadow: [BoxShadow(
                    spreadRadius: 2, blurRadius: 10,
                    color: Colors.white.withOpacity(0.1),
                    offset: Offset(0,10),
                  ),
                  ],
                  shape: BoxShape.circle,
                  image: DecorationImage(
                    fit: BoxFit.cover,
                    image: NetworkImage("https://www.senertec.de/wp-content/uploads/2020/04/blank-profile-picture-973460_1280.png"),
                  )
              ),
            ),
            Text(widget.userName,
              style: TextStyle(
                  color: Colors.white,
                  fontFamily: 'Orbitron',
                  fontSize: 20.0,
                  fontWeight: FontWeight.bold,
              ),),
          ],
        ),

标签: flutterwidget

解决方案


尝试使用 Row() 而不是 Column()


推荐阅读