refactor: introduce HomeDashboardData entity, convert ClientHomePage to StatelessWidget, and update deprecated color methods in the client home feature.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'mocks/auth_repository_mock.dart';
|
||||
import 'mocks/home_repository_mock.dart';
|
||||
|
||||
/// A module that provides Data Connect dependencies, including mocks.
|
||||
class DataConnectModule extends Module {
|
||||
@@ -7,5 +8,6 @@ class DataConnectModule extends Module {
|
||||
void exportedBinds(Injector i) {
|
||||
// Make the AuthRepositoryMock available to any module that imports this one.
|
||||
i.addLazySingleton(AuthRepositoryMock.new);
|
||||
i.addLazySingleton(HomeRepositoryMock.new);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:krow_domain/krow_domain.dart';
|
||||
|
||||
/// Mock implementation of data source for Home dashboard data.
|
||||
///
|
||||
/// This mock simulates backend responses for dashboard-related queries.
|
||||
class HomeRepositoryMock {
|
||||
/// Returns a mock [HomeDashboardData].
|
||||
Future<HomeDashboardData> getDashboardData() async {
|
||||
// Simulate network delay
|
||||
await Future.delayed(const Duration(milliseconds: 500));
|
||||
|
||||
return const HomeDashboardData(
|
||||
weeklySpending: 4250.0,
|
||||
next7DaysSpending: 6100.0,
|
||||
weeklyShifts: 12,
|
||||
next7DaysScheduled: 18,
|
||||
totalNeeded: 10,
|
||||
totalFilled: 8,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user