Flutter小部件彼此之间不在顶部,而是彼此相邻

时间:2020-09-22 16:34:45

标签: flutter widget

有人可以将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,
              ),),
          ],
        ),

1 个答案:

答案 0 :(得分:1)

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