Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 不考虑最小宽度和最小高度的框约束_Flutter_Dart - Fatal编程技术网

Flutter 不考虑最小宽度和最小高度的框约束

Flutter 不考虑最小宽度和最小高度的框约束,flutter,dart,Flutter,Dart,我的容器宽度和高度大小默认为BoxConstraints中设置的minWidth和maxWidth属性,这与我想要的结果相反。它应该从最小宽度开始增长,然后达到最大宽度并停止增长。代码如下 Container( margin: EdgeInsets.only(top: reapeatedReply == false ? 10 : 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, ma

我的容器宽度和高度大小默认为BoxConstraints中设置的minWidth和maxWidth属性,这与我想要的结果相反。它应该从最小宽度开始增长,然后达到最大宽度并停止增长。代码如下

Container(
    margin: EdgeInsets.only(top: reapeatedReply == false ? 10 : 0),
    child: Row(
      crossAxisAlignment: CrossAxisAlignment.start,
      mainAxisAlignment: MainAxisAlignment.end,
      mainAxisSize: MainAxisSize.max,
      children: <Widget>[
        Container(
          padding: EdgeInsets.symmetric(
            horizontal: 10,
            vertical: 5,
          ),
          // margin: EdgeInsets.only(right: reapeatedReply == true ? 12 : 0, bottom: 3),
          margin: EdgeInsets.only(right: 12, bottom: 3),
          constraints: BoxConstraints(
            maxWidth: deviceSize.width * 0.8,
          ),
          decoration: BoxDecoration(
            color: Color(0xFFFFF5C7),
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(10),
                bottomLeft: Radius.circular(10),
                bottomRight: Radius.circular(10),
                topRight: reapeatedReply == true
                    ? Radius.circular(10)
                    : Radius.zero),
          ),
          child: Column(
              crossAxisAlignment: CrossAxisAlignment.end,
              children: <Widget>[
                Text(
                  text,
                  style: Theme.of(context)
                      .textTheme
                      .body1
                      .copyWith(color: Colors.black),
                ),
                Align(
                  alignment: Alignment.bottomRight,
                  child: Padding(
                    padding: const EdgeInsets.only(top: 5),
                    child: Text(
                      "8:45 PM",
                      style: Theme.of(context)
                          .textTheme
                          .body1
                          .copyWith(fontSize: 12),
                    ),
                  ),
                )
              ]),
        ),
      ],
    ),
  )),
容器(
边距:仅限边集(顶部:reapeatedReply==false?10:0),
孩子:排(
crossAxisAlignment:crossAxisAlignment.start,
mainAxisAlignment:mainAxisAlignment.end,
mainAxisSize:mainAxisSize.max,
儿童:[
容器(
填充:EdgeInsets.symmetric(
横向:10,
垂直:5,
),
//边距:仅限边集(右:reapeatedReply==true?12:0,底部:3),
页边距:仅限边集(右侧:12,底部:3),
约束:BoxConstraints(
maxWidth:deviceSize.width*0.8,
),
装饰:盒子装饰(
颜色:颜色(0xFFFFF5C7),
borderRadius:仅限borderRadius(
左上:半径。圆形(10),
左下角:半径。圆形(10),
右下角:半径。圆形(10),
右上角:reapeatedReply==true
?半径。圆形(10)
:半径0),
),
子:列(
crossAxisAlignment:crossAxisAlignment.end,
儿童:[
正文(
文本,
风格:主题(上下文)
.文本主题
.body1
.copyWith(颜色:颜色。黑色),
),
对齐(
对齐:对齐。右下角,
孩子:填充(
填充:仅限常量边集(顶部:5),
子:文本(
“晚上8:45”,
风格:主题(上下文)
.文本主题
.body1
.copyWith(字体大小:12),
),
),
)
]),
),
],
),
)),