feat: Refactor context reading in emergency contact and FAQs widgets

- Updated the context reading method in `EmergencyContactAddButton` and `EmergencyContactFormItem` to use `ReadContext`.
- Modified the `FaqsWidget` to utilize `ReadContext` for fetching FAQs.
- Adjusted the `PrivacySectionWidget` to read from `PrivacySecurityBloc` using `ReadContext`.

feat: Implement Firebase Auth isolation pattern

- Introduced `FirebaseAuthService` and `FirebaseAuthServiceImpl` to abstract Firebase Auth operations.
- Ensured features do not directly import `firebase_auth`, adhering to architecture rules.

feat: Create repository interfaces for billing and coverage

- Added `BillingRepositoryInterface` for billing-related operations.
- Created `CoverageRepositoryInterface` for coverage data access.

feat: Add use cases for order management

- Implemented use cases for fetching hubs, managers, and roles related to orders.
- Created `GetHubsUseCase`, `GetManagersByHubUseCase`, and `GetRolesByVendorUseCase`.

feat: Develop report use cases for client reports

- Added use cases for fetching various reports including coverage, daily operations, forecast, no-show, performance, and spend reports.
- Implemented `GetCoverageReportUseCase`, `GetDailyOpsReportUseCase`, `GetForecastReportUseCase`, `GetNoShowReportUseCase`, `GetPerformanceReportUseCase`, and `GetSpendReportUseCase`.

feat: Establish profile repository and use cases

- Created `ProfileRepositoryInterface` for staff profile data access.
- Implemented use cases for retrieving staff profile and section statuses: `GetStaffProfileUseCase` and `GetProfileSectionsUseCase`.
- Added `SignOutUseCase` for signing out the current user.
This commit is contained in:
Achintha Isuru
2026-03-19 01:10:27 -04:00
parent a45a3f6af1
commit 843eec5692
123 changed files with 2102 additions and 1087 deletions

View File

@@ -3,6 +3,7 @@ import 'package:design_system/design_system.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:krow_core/core.dart';
import 'package:krow_domain/krow_domain.dart';
import 'package:client_hubs/src/presentation/blocs/edit_hub/edit_hub_bloc.dart';
@@ -38,7 +39,7 @@ class EditHubPage extends StatelessWidget {
message: message,
type: UiSnackbarType.success,
);
Modular.to.pop(true);
Modular.to.popSafe(true);
}
if (state.status == EditHubStatus.failure &&
state.errorMessage != null) {
@@ -65,7 +66,7 @@ class EditHubPage extends StatelessWidget {
child: HubForm(
hub: hub,
costCenters: state.costCenters,
onCancel: () => Modular.to.pop(),
onCancel: () => Modular.to.popSafe(),
onSave: ({
required String name,
required String fullAddress,

View File

@@ -38,7 +38,7 @@ class HubDetailsPage extends StatelessWidget {
message: message,
type: UiSnackbarType.success,
);
Modular.to.pop(true); // Return true to indicate change
Modular.to.popSafe(true); // Return true to indicate change
}
if (state.status == HubDetailsStatus.failure &&
state.errorMessage != null) {
@@ -117,7 +117,7 @@ class HubDetailsPage extends StatelessWidget {
Future<void> _navigateToEditPage(BuildContext context) async {
final bool? saved = await Modular.to.toEditHub(hub: hub);
if (saved == true && context.mounted) {
Modular.to.pop(true); // Return true to indicate change
Modular.to.popSafe(true); // Return true to indicate change
}
}

View File

@@ -112,7 +112,7 @@ class _HubFormState extends State<HubForm> {
vertical: 16,
),
decoration: BoxDecoration(
color: const Color(0xFFF8FAFD),
color: UiColors.muted,
borderRadius: BorderRadius.circular(
UiConstants.radiusBase * 1.5,
),
@@ -225,7 +225,7 @@ class _HubFormState extends State<HubForm> {
color: UiColors.textSecondary.withValues(alpha: 0.5),
),
filled: true,
fillColor: const Color(0xFFF8FAFD),
fillColor: UiColors.muted,
contentPadding: const EdgeInsets.symmetric(
horizontal: UiConstants.space4,
vertical: 16,