driving_consent 0.4.0
driving_consent: ^0.4.0 copied to clipboard
No consent? No data leaves the device. Privacy-first consent gate where UNKNOWN equals DENIED. Per-purpose consent, GDPR/CCPA/APPI-ready, with pluggable storage. Pure Dart, no Flutter dependency.
example/main.dart
import 'package:driving_consent/driving_consent.dart';
Future<void> main() async {
final service = InMemoryConsentService();
final initial = await service.getConsent(ConsentPurpose.fleetLocation);
print('initial: ${initial.status.name} '
'(effective=${initial.isEffectivelyGranted})');
await service.grant(ConsentPurpose.fleetLocation, Jurisdiction.appi);
final granted = await service.getConsent(ConsentPurpose.fleetLocation);
print('after grant: ${granted.status.name} '
'(effective=${granted.isEffectivelyGranted})');
await service.revoke(ConsentPurpose.fleetLocation);
final revoked = await service.getConsent(ConsentPurpose.fleetLocation);
print('after revoke: ${revoked.status.name} '
'(effective=${revoked.isEffectivelyGranted})');
await service.dispose();
}