我正在创建用户界面的帐户页面与订单列表。我需要添加箭头按钮到篮子部件的右侧。我创建了3行列,但我不知道如何添加箭头按钮的右侧。
class BasketItem extends StatelessWidget {
const BasketItem({
super.key,
});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
height: 95,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10)
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('#462', style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey[700]),),
Text('Processing', style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey[700]),),
],
),
SizedBox(height: 15),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('299.99', style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey[700], fontSize: 18),),
Text('2023-09-21', style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey[700]),),
],
),
SizedBox(height: 5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('1 item', style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey[700]),),
Text('09:31 PM', style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey[700]),),
],
),
],
),
);
}
}
3条答案
按热度按时间1bqhqjot1#
您可以在这个例子中尝试使用卡片和列。这是最基本的方法,你可以尝试学习其他的方法。您可以更改字体大小和列间距。
c90pui9n2#
将
Column
Package 为Row
,并将Column
展开为Expanded
完整代码:-
输出:-
nbysray53#
这可以通过ListTile Widget轻松实现。
Sudo代码
**
title:
**可以取任意一个Widget
作为子节点。您可以在这里替换现有代码。