This commit is contained in:
@@ -308,6 +308,30 @@ class _PurchasePageState extends State<PurchasePage>
|
||||
],
|
||||
),
|
||||
const SpaceHeight(12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: PurchaseStatCard(
|
||||
title: 'Bahan Baku',
|
||||
value: s.rawMaterialPurchases.currencyFormatRp,
|
||||
icon: LineIcons.leaf,
|
||||
iconColor: AppColor.secondary,
|
||||
cardAnimation: _fadeAnimation,
|
||||
),
|
||||
),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: PurchaseStatCard(
|
||||
title: 'Pengeluaran',
|
||||
value: s.expensePurchases.currencyFormatRp,
|
||||
icon: LineIcons.receipt,
|
||||
iconColor: AppColor.warning,
|
||||
cardAnimation: _fadeAnimation,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SpaceHeight(12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -325,7 +349,7 @@ class _PurchasePageState extends State<PurchasePage>
|
||||
title: 'Rata-rata PO',
|
||||
value: s.averagePurchaseOrderValue.round().currencyFormatRp,
|
||||
icon: LineIcons.dollarSign,
|
||||
iconColor: AppColor.secondary,
|
||||
iconColor: AppColor.secondaryDark,
|
||||
cardAnimation: _fadeAnimation,
|
||||
),
|
||||
),
|
||||
@@ -336,7 +360,7 @@ class _PurchasePageState extends State<PurchasePage>
|
||||
children: [
|
||||
Expanded(
|
||||
child: PurchaseStatCard(
|
||||
title: 'Bahan Baku',
|
||||
title: 'Item Bahan Baku',
|
||||
value: '${s.totalIngredients} item',
|
||||
icon: LineIcons.leaf,
|
||||
iconColor: AppColor.secondaryDark,
|
||||
@@ -554,6 +578,14 @@ class _PurchasePageState extends State<PurchasePage>
|
||||
Expanded(child: _shimmerCard(height: 100)),
|
||||
],
|
||||
),
|
||||
const SpaceHeight(12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: _shimmerCard(height: 100)),
|
||||
const SpaceWidth(12),
|
||||
Expanded(child: _shimmerCard(height: 100)),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ class PurchaseVendorCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
// Rank badge
|
||||
Container(
|
||||
@@ -69,7 +70,7 @@ class PurchaseVendorCard extends StatelessWidget {
|
||||
color: AppColor.info.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
LineIcons.truck,
|
||||
color: AppColor.info,
|
||||
size: 20,
|
||||
@@ -77,31 +78,51 @@ class PurchaseVendorCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
|
||||
// Name & details
|
||||
// Name, chips, and total cost — all in one column
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
data.vendorName.trim(),
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
// Vendor name + total cost on same row
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
data.vendorName.trim(),
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
data.totalCost.currencyFormatRp,
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.w800,
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
|
||||
// Chips — wrap to next line if not enough space
|
||||
Wrap(
|
||||
spacing: 6,
|
||||
runSpacing: 4,
|
||||
children: [
|
||||
_Chip(
|
||||
label: '${data.purchaseOrderCount} PO',
|
||||
color: AppColor.info,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
_Chip(
|
||||
label: '${data.ingredientCount} bahan',
|
||||
color: AppColor.secondary,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
_Chip(
|
||||
label: '${data.quantity} pcs',
|
||||
color: AppColor.warning,
|
||||
@@ -111,15 +132,6 @@ class PurchaseVendorCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// Total cost
|
||||
Text(
|
||||
data.totalCost.currencyFormatRp,
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.w800,
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user