Chnaged the Expense Naming and Dashboard menu handeling and chart modifications

This commit is contained in:
Vaibhav Surve 2025-11-12 15:58:29 +05:30
parent 6b56351a49
commit 11393922e2
4 changed files with 24 additions and 57 deletions

View File

@ -129,57 +129,24 @@ class _ChartHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Obx(() {
final data = controller.expenseTypeReportData.value;
// Calculate total from totalApprovedAmount only
final total = data?.report.fold<double>(
0,
(sum, e) => sum + e.totalApprovedAmount,
) ??
0;
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MyText.bodyMedium('Project Expense Analytics', fontWeight: 700),
const SizedBox(height: 2),
MyText.bodySmall('Approved expenses by project',
color: Colors.grey),
],
),
return Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MyText.bodyMedium('Project Expense Analytics', fontWeight: 700),
SizedBox(height: 2),
MyText.bodySmall(
'Approved expenses by project',
color: Colors.grey,
),
],
),
if (total > 0)
Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
decoration: BoxDecoration(
color: Colors.blueAccent.withOpacity(0.15),
borderRadius: BorderRadius.circular(5),
border: Border.all(color: Colors.blueAccent, width: 1),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
MyText.bodySmall(
'Total Approved',
color: Colors.blueAccent,
fontSize: 10,
),
MyText.bodyMedium(
Utils.formatCurrency(total),
color: Colors.blueAccent,
fontWeight: 700,
fontSize: 14,
),
],
),
),
],
);
});
),
],
);
}
}

View File

@ -40,8 +40,8 @@ class ExpenseByStatusWidget extends StatelessWidget {
children: [
MyText.bodyMedium(title, fontWeight: 600),
const SizedBox(height: 2),
MyText.titleMedium(amount,
color: Colors.blue, fontWeight: 700),
MyText.bodySmall(amount,
color: Colors.indigo, fontWeight: 600),
],
),
),
@ -157,7 +157,7 @@ class ExpenseByStatusWidget extends StatelessWidget {
// Status tiles
_buildStatusTile(
icon: Icons.currency_rupee,
color: Colors.blue,
color: Colors.indigo,
title: "Pending Payment",
amount: Utils.formatCurrency(data.processPending.totalAmount),
count: data.processPending.count.toString(),
@ -223,7 +223,7 @@ class ExpenseByStatusWidget extends StatelessWidget {
MyText.titleLarge(
Utils.formatCurrency(data.totalAmount),
color: Colors.blue,
fontWeight: 700,
fontWeight: 600,
),
const SizedBox(width: 6),
const Icon(Icons.chevron_right,

View File

@ -40,7 +40,7 @@ class ExpenseAppBar extends StatelessWidget implements PreferredSizeWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MyText.titleLarge('Expenses', fontWeight: 700),
MyText.titleLarge('Expense & Reimbursement', fontWeight: 700),
MySpacing.height(2),
GetBuilder<ProjectController>(
builder: (_) {

View File

@ -128,7 +128,7 @@ class _FinanceScreenState extends State<FinanceScreen>
}
// Only allow finance cards if "Expense" menu is allowed
final isExpenseAllowed = menuController.isMenuAllowed("Expense");
final isExpenseAllowed = menuController.isMenuAllowed("Expense & Reimbursement");
if (!isExpenseAllowed) {
return const Center(
@ -161,7 +161,7 @@ class _FinanceScreenState extends State<FinanceScreen>
// --- Finance Modules (Compact Dashboard-style) ---
Widget _buildFinanceModulesCompact() {
final stats = [
_FinanceStatItem(LucideIcons.badge_dollar_sign, "Expense",
_FinanceStatItem(LucideIcons.badge_dollar_sign, "Expense & Reimbursement",
contentTheme.info, "/dashboard/expense-main-page"),
_FinanceStatItem(LucideIcons.receipt_text, "Payment Request",
contentTheme.primary, "/dashboard/payment-request"),