Implementation
Widget transactionHistoryCard() {
return LayoutBuilder(
builder: (context, constraints) {
return Padding(
padding: const EdgeInsets.only(top: 27),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Title
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
'Transaction History',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: ColorHelper.neutralText,
),
),
Container(
padding:
const EdgeInsets.symmetric(horizontal: 6.0, vertical: 6.0),
decoration: BoxDecoration(
color: ColorHelper.lightGrey, // Light green background
borderRadius: BorderRadius.circular(8),
),
child: Icon(
Icons.sort,
size: 18,
color: Colors.grey[700],
),
),
],
),
10.SpaceX,
// Details Card
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
width: max(constraints.maxWidth - 44.dp, 500.dp),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: Border.all(color: ColorHelper.grey01, width: 1),
color: Colors.white),
child: Table(
columnWidths: const {
0: FlexColumnWidth(1),
1: FlexColumnWidth(1),
2: FlexColumnWidth(1),
3: FlexColumnWidth(1),
},
children: [
TableRow(
decoration: const BoxDecoration(
color: ColorHelper.lightBg02,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16),
topRight: Radius.circular(16),
)),
children: [
tableLabel('Transaction ID'),
tableLabel('Date'),
tableLabel('Commissions'),
tableLabel('Type'),
],
),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'Neo Miles', '230', 'Received', 0),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'USDT', '165', 'Received', 1),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'Neo Miles', '230', 'Received', 2),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'USDT', '165', 'Received', 3),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'Neo Miles', '230', 'Received', 4),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'Neo Miles', '230', 'Transferred', 5),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'Neo Miles', '230', 'Received', 6),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'USDT', '165', 'Received', 7),
buildTransactionHistoryTableRow('sdjhad67ede9e7w98df51',
'Fri, 09-0802024', 'Neo Miles', '230', 'Received', 8),
],
),
),
),
],
),
);
}
);
}