refactor: introduce HomeDashboardData entity, convert ClientHomePage to StatelessWidget, and update deprecated color methods in the client home feature.

This commit is contained in:
Achintha Isuru
2026-01-21 16:33:55 -05:00
parent eb10254757
commit 7d5a40b7e3
18 changed files with 379 additions and 168 deletions

View File

@@ -0,0 +1,45 @@
import 'package:equatable/equatable.dart';
/// Entity representing dashboard data for the home screen.
///
/// This entity provides aggregated metrics such as spending and shift counts
/// for both the current week and the upcoming 7 days.
class HomeDashboardData extends Equatable {
/// Total spending for the current week.
final double weeklySpending;
/// Projected spending for the next 7 days.
final double next7DaysSpending;
/// Total shifts scheduled for the current week.
final int weeklyShifts;
/// Shifts scheduled for the next 7 days.
final int next7DaysScheduled;
/// Total workers needed for today's shifts.
final int totalNeeded;
/// Total workers filled for today's shifts.
final int totalFilled;
/// Creates a [HomeDashboardData] instance.
const HomeDashboardData({
required this.weeklySpending,
required this.next7DaysSpending,
required this.weeklyShifts,
required this.next7DaysScheduled,
required this.totalNeeded,
required this.totalFilled,
});
@override
List<Object?> get props => [
weeklySpending,
next7DaysSpending,
weeklyShifts,
next7DaysScheduled,
totalNeeded,
totalFilled,
];
}