美文网首页
flutter 动态高度

flutter 动态高度

作者: neobuger | 来源:发表于2023-03-28 10:31 被阅读0次
    Container(
          padding: EdgeInsets.only(left: 15, right: 15, top: 5),
          // height: 50,
          constraints: BoxConstraints(
            minHeight: 50,
            // maxHeight: 250
          ),
          // padding: EdgeInsets.all(15),
          child: IntrinsicHeight(
    
            child: Column(
              children: [
                Expanded(
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [
                        Expanded(
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.start,
                              crossAxisAlignment: CrossAxisAlignment.center,
                              children: [
                                Container(
                                  constraints: BoxConstraints(
                                    // minHeight: 50,
                                      maxWidth: 250
                                  ),
                                  child: Text(
                                    "某某某公司",
                                    style: TextStyle(
                                        fontSize: 17,
                                        color: Color(0xff444444),
                                        fontWeight: FontWeight.w600
                                    ),
                                    // softWrap: false,
                                    // overflow: TextOverflow.ellipsis
                                  ),
                                ),
                                SizedBox(width: 5,),
                                Center(
                                  child: Image.asset("images/CMC_more.png",
                                    package: "work_outside_c",
                                    width: 8,
                                    height: 12,),
                                )
                              ],
                            )
                        ),
                        SizedBox(width: 20,),
                        Text(getWanchengStatus(), style: TextStyle(
                            fontSize: 14,
                            color: getWanchengStatusColor(),
                            fontWeight: FontWeight.w600
                        ))
                      ],
                    )
                ),
                Container(
                  color: Color(0xffDDDDDD),
                  // margin: EdgeInsets.only(left: 15, right: 15),
                  height: 1,
                )
              ],
            ),
          ),
        )
    

    IntrinsicHeight

    constraints设置了最小高度

    相关文章

      网友评论

          本文标题:flutter 动态高度

          本文链接:https://www.haomeiwen.com/subject/ekitddtx.html