Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.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_Flutter Layout - Fatal编程技术网

Flutter 颤栗我怎么能把一个图标排成一行

Flutter 颤栗我怎么能把一个图标排成一行,flutter,dart,flutter-layout,Flutter,Dart,Flutter Layout,, 如何使图标行与左边框对齐 我的代码是: Container( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.height / 13, alignment: AlignmentDirectional.centerStart, child: Row( children: <Widget>[

,

如何使图标行与左边框对齐

我的代码是:

Container(
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height / 13,
        alignment: AlignmentDirectional.centerStart,
        child: Row(
          children: <Widget>[
            SizedBox(width: 25.0),
            Text(
              "hello world"
            ),
            SizedBox(width: getWidth() * 185.0),
            Align(
              alignment: Alignment.centerLeft,
              child: Icon(
                Icons.check,
                size: 20,
                color: Colors.grey,
              ),
            ),
          ],
        ),
      ),
容器(
宽度:MediaQuery.of(context).size.width,
高度:MediaQuery.of(context).size.height/13,
对齐:AlignmentDirective.centerStart,
孩子:排(
儿童:[
尺寸箱(宽度:25.0),
正文(
“你好,世界”
),
SizedBox(宽度:getWidth()*185.0),
对齐(
对齐:alignment.centerLeft,
子:图标(
图标。检查,
尺码:20,
颜色:颜色。灰色,
),
),
],
),
),

试着用这种方法将
文本
小部件包装在
扩展()中
小部件它会工作的

Container(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height / 13,
          alignment: AlignmentDirectional.centerStart,
          child: Row(
            children: <Widget>[
              SizedBox(width: 25.0),
              Expanded(
                child: Text(
                    "hello world"
                ),
              ),
              SizedBox(width: 20),
              Align(
                alignment: Alignment.centerLeft,
                child: Icon(
                  Icons.check,
                  size: 20,
                  color: Colors.grey,
                ),
              ),
              SizedBox(width: 20),
            ],
          ),
        )
容器(
宽度:MediaQuery.of(context).size.width,
高度:MediaQuery.of(context).size.height/13,
对齐:AlignmentDirective.centerStart,
孩子:排(
儿童:[
尺寸箱(宽度:25.0),
扩大(
子:文本(
“你好,世界”
),
),
尺寸箱(宽度:20),
对齐(
对齐:alignment.centerLeft,
子:图标(
图标。检查,
尺码:20,
颜色:颜色。灰色,
),
),
尺寸箱(宽度:20),
],
),
)
输出


试着用这种方法将
文本
小部件包装在
扩展()中
小部件它会工作的

Container(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height / 13,
          alignment: AlignmentDirectional.centerStart,
          child: Row(
            children: <Widget>[
              SizedBox(width: 25.0),
              Expanded(
                child: Text(
                    "hello world"
                ),
              ),
              SizedBox(width: 20),
              Align(
                alignment: Alignment.centerLeft,
                child: Icon(
                  Icons.check,
                  size: 20,
                  color: Colors.grey,
                ),
              ),
              SizedBox(width: 20),
            ],
          ),
        )
容器(
宽度:MediaQuery.of(context).size.width,
高度:MediaQuery.of(context).size.height/13,
对齐:AlignmentDirective.centerStart,
孩子:排(
儿童:[
尺寸箱(宽度:25.0),
扩大(
子:文本(
“你好,世界”
),
),
尺寸箱(宽度:20),
对齐(
对齐:alignment.centerLeft,
子:图标(
图标。检查,
尺码:20,
颜色:颜色。灰色,
),
),
尺寸箱(宽度:20),
],
),
)
输出


你能分享你的预期输出吗?你能分享你的预期输出吗