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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Obx(() { return Row(
final data = controller.expenseTypeReportData.value; mainAxisAlignment: MainAxisAlignment.start,
// Calculate total from totalApprovedAmount only children: [
final total = data?.report.fold<double>( Expanded(
0, child: Column(
(sum, e) => sum + e.totalApprovedAmount, crossAxisAlignment: CrossAxisAlignment.start,
) ?? children: [
0; MyText.bodyMedium('Project Expense Analytics', fontWeight: 700),
SizedBox(height: 2),
return Row( MyText.bodySmall(
mainAxisAlignment: MainAxisAlignment.spaceBetween, 'Approved expenses by project',
children: [ color: Colors.grey,
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),
],
),
), ),
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: [ children: [
MyText.bodyMedium(title, fontWeight: 600), MyText.bodyMedium(title, fontWeight: 600),
const SizedBox(height: 2), const SizedBox(height: 2),
MyText.titleMedium(amount, MyText.bodySmall(amount,
color: Colors.blue, fontWeight: 700), color: Colors.indigo, fontWeight: 600),
], ],
), ),
), ),
@ -157,7 +157,7 @@ class ExpenseByStatusWidget extends StatelessWidget {
// Status tiles // Status tiles
_buildStatusTile( _buildStatusTile(
icon: Icons.currency_rupee, icon: Icons.currency_rupee,
color: Colors.blue, color: Colors.indigo,
title: "Pending Payment", title: "Pending Payment",
amount: Utils.formatCurrency(data.processPending.totalAmount), amount: Utils.formatCurrency(data.processPending.totalAmount),
count: data.processPending.count.toString(), count: data.processPending.count.toString(),
@ -223,7 +223,7 @@ class ExpenseByStatusWidget extends StatelessWidget {
MyText.titleLarge( MyText.titleLarge(
Utils.formatCurrency(data.totalAmount), Utils.formatCurrency(data.totalAmount),
color: Colors.blue, color: Colors.blue,
fontWeight: 700, fontWeight: 600,
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
const Icon(Icons.chevron_right, const Icon(Icons.chevron_right,

View File

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

View File

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