transactionDetailCard function
Implementation
Widget transactionDetailCard({
required String transactionType,
required String amount,
required String orderId,
required String date,
required String status,
required String credited,
}) {
return Container(
margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 4,
offset: Offset(0, 2),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
status.toUpperCase() == "SUCCESS"
? Icons.check_circle
: Icons.cancel,
color: Colors.green),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
transactionType,
style: const TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
const SizedBox(height: 8),
Text(
"Order Id: $orderId",
style: TextStyle(
fontSize: 13,
color: Colors.grey.shade700,
),
),
const SizedBox(height: 4),
Text(
"Date: $date",
style: TextStyle(
fontSize: 13,
color: Colors.grey.shade700,
),
),
],
),
),
Text(
"$amount",
style: TextStyle(
color: credited != "" ? Colors.green : Colors.red,
fontWeight: FontWeight.w600,
fontSize: 16,
),
),
],
),
],
),
);
}