【发布时间】:2020-01-01 11:28:25
【问题描述】:
我有一个Card,其中包含多个Text 和一个Image。现在图像位于顶部中心,我需要将其与卡片内的右侧对齐。
我需要卡片左侧的所有文字和右侧的图像。
所以,基本上所有Text 都应该在左侧,Image 应该在右侧。
这是我现在实现的卡片,
这是我已经实现的代码
Widget _buildItemsForListView(BuildContext context, int index) {
return Card(
child: Column(
children: <Widget>[
Image.asset(Constants.FOOD_PLACEHOLDER_IMAGE_ASSET_URL, height: 50,width: 100),
Text("Spinach soup",
style: TextStyle(color: Colors.deepPurple, fontSize: 16),
textAlign: TextAlign.left,),
Text("SAR",
style: TextStyle(color: Colors.black, fontSize: 14),
textAlign: TextAlign.left),
Text("26",
style: TextStyle(color: Colors.black, fontSize: 14),
textAlign: TextAlign.left,),
Text(
"Fresh spinach, mushrooms, and hard-boiled egg served with warm bacon vinaigrette",
style: TextStyle(color: Colors.black, fontSize: 14),
textAlign: TextAlign.left,),
Text("15.4" + " Calories",
style: TextStyle(color: Colors.black, fontSize: 14),
textAlign: TextAlign.left,)
],
),
);
}
如何实现?
任何建议都会有所帮助。
【问题讨论】:
-
这个问题非常误导。我提出了修改建议,请接受。
-
您还需要什么详细信息?我已经在这个问题中包含了我可以提供的所有内容
-
你想要图像和文本并排,还是右上角的图像和左下角的文本?
-
@若昂·苏亚雷斯!我需要卡片左侧的所有文本和右侧的图像。我想要并排的图像!!!!
标签: flutter dart flutter-layout