diff --git a/apps/mobile/packages/domain/lib/krow_domain.dart b/apps/mobile/packages/domain/lib/krow_domain.dart index 1460611e..adebada8 100644 --- a/apps/mobile/packages/domain/lib/krow_domain.dart +++ b/apps/mobile/packages/domain/lib/krow_domain.dart @@ -12,6 +12,9 @@ export 'src/core/services/api_services/base_api_service.dart'; export 'src/core/services/api_services/base_core_service.dart'; export 'src/core/services/api_services/file_visibility.dart'; +// Device +export 'src/core/services/device/base_device_service.dart'; + // Users & Membership export 'src/entities/users/user.dart'; export 'src/entities/users/staff.dart'; diff --git a/apps/mobile/packages/domain/lib/src/core/services/device/base_device_service.dart b/apps/mobile/packages/domain/lib/src/core/services/device/base_device_service.dart new file mode 100644 index 00000000..b8f030fc --- /dev/null +++ b/apps/mobile/packages/domain/lib/src/core/services/device/base_device_service.dart @@ -0,0 +1,22 @@ +/// Abstract base class for device-related services. +/// +/// Device services handle native hardware/platform interactions +/// like Camera, Gallery, Location, or Biometrics. +abstract class BaseDeviceService { + const BaseDeviceService(); + + /// Standardized wrapper to execute device actions. + /// + /// This can be used for common handling like logging device interactions + /// or catching native platform exceptions. + Future action(Future Function() execution) async { + try { + return await execution(); + } catch (e) { + // Re-throw or handle based on project preference. + // For device services, we might want to throw specific + // DeviceExceptions later. + rethrow; + } + } +}