feat: Implement notification and storage services, geofence management, and BLoC for geofence verification

- Add NotificationService for handling local notifications.
- Introduce StorageService for key-value storage using SharedPreferences.
- Create DeviceLocation model to represent geographic locations.
- Define LocationPermissionStatus enum for managing location permissions.
- Implement BackgroundGeofenceService for periodic geofence checks while clocked in.
- Develop GeofenceServiceImpl for geofence proximity verification using LocationService.
- Create GeofenceResult model to encapsulate geofence check results.
- Define GeofenceServiceInterface for geofence service abstraction.
- Implement GeofenceBloc to manage geofence verification and background tracking.
- Create events and states for GeofenceBloc to handle various geofence scenarios.
- Add GeofenceStatusBanner widget to display geofence verification status in the UI.
This commit is contained in:
Achintha Isuru
2026-03-13 16:01:26 -04:00
parent 2fc6b3139e
commit 7b576c0ed4
54 changed files with 2216 additions and 493 deletions

View File

@@ -14,6 +14,10 @@ export 'src/core/services/api_services/file_visibility.dart';
// Device
export 'src/core/services/device/base_device_service.dart';
export 'src/core/services/device/location_permission_status.dart';
// Models
export 'src/core/models/device_location.dart';
// Users & Membership
export 'src/entities/users/user.dart';

View File

@@ -0,0 +1,27 @@
import 'package:equatable/equatable.dart';
/// Represents a geographic location obtained from the device.
class DeviceLocation extends Equatable {
/// Latitude in degrees.
final double latitude;
/// Longitude in degrees.
final double longitude;
/// Estimated horizontal accuracy in meters.
final double accuracy;
/// Time when this location was determined.
final DateTime timestamp;
/// Creates a [DeviceLocation] instance.
const DeviceLocation({
required this.latitude,
required this.longitude,
required this.accuracy,
required this.timestamp,
});
@override
List<Object?> get props => [latitude, longitude, accuracy, timestamp];
}

View File

@@ -0,0 +1,17 @@
/// Represents the current state of location permission granted by the user.
enum LocationPermissionStatus {
/// Full location access granted.
granted,
/// Location access granted only while the app is in use.
whileInUse,
/// Location permission was denied by the user.
denied,
/// Location permission was permanently denied by the user.
deniedForever,
/// Device location services are disabled.
serviceDisabled,
}