refactor: introduce HomeDashboardData entity, convert ClientHomePage to StatelessWidget, and update deprecated color methods in the client home feature.
This commit is contained in:
@@ -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,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user