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),
],
),
)
输出
你能分享你的预期输出吗?你能分享你的预期输出吗