【发布时间】:2019-11-19 17:32:45
【问题描述】:
在我的颤振项目中,我已经初始化了一个 Row。在其中,我在一列中创建了一些文本,之后,我想添加一行,但它没有显示任何内容。出于这个原因,我使用了 Expanded 并遵循了给定的解决方案-
Horizontal divider with text in the middle in Flutter?
但它们都没有工作。
这是我的代码输出的图像-
这是我的代码-
Container(
color:Colors.white,
child: (
Row(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Image(
height: 100,
width: 100,
image: NetworkImage("https://www.gstatic.com/webp/gallery/1.jpg"),
),
),
Column(
children: <Widget>[
Text("Book Name"),
Text("Author name"),
Divider(
color: Colors.black,
)
],
)
],
)
),
),
所以,我需要在两个文本下方添加一行,如下图所示-
【问题讨论】:
-
尝试将分隔线的颜色更改为黑色并删除扩展
-
我已经编辑了代码,但仍然无法正常工作。请检查@Abbas.M