PrivacyService class abstract

Service interface for privacy zone operations.

Privacy zones allow users to define areas where their location data should be obfuscated or excluded, supporting GDPR compliance and user privacy preferences.

Example:

// Add a privacy zone around home
await Locus.privacy.add(PrivacyZone.create(
  identifier: 'home',
  latitude: 37.7749,
  longitude: -122.4194,
  radius: 100.0,
  action: PrivacyZoneAction.obfuscate,
  obfuscationRadius: 500.0,
));

// Listen to privacy zone events
Locus.privacy.events.listen((event) {
  print('Privacy zone ${event.zone.identifier}: ${event.action}');
});
Implementers

Constructors

PrivacyService()

Properties

events Stream<PrivacyZoneEvent>
Stream of privacy zone change events.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(PrivacyZone zone) Future<void>
Adds a privacy zone.
addAll(List<PrivacyZone> zones) Future<void>
Adds multiple privacy zones.
get(String identifier) Future<PrivacyZone?>
Gets a privacy zone by identifier.
getAll() Future<List<PrivacyZone>>
Gets all registered privacy zones.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onChange(void callback(PrivacyZoneEvent)) → void
Subscribes to privacy zone change events.
remove(String identifier) Future<bool>
Removes a privacy zone by identifier.
removeAll() Future<void>
Removes all privacy zones.
setEnabled(String identifier, bool enabled) Future<bool>
Enables or disables a privacy zone.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited