permission_plus_windows 1.0.0
permission_plus_windows: ^1.0.0 copied to clipboard
Windows implementation of the permission_plus plugin.
permission_plus_windows #
The Windows implementation of permission_plus.
Usage #
This package is endorsed and will be automatically included when you depend on permission_plus. There is no need to add this package to your pubspec.yaml directly.
Users should depend on permission_plus instead of this package.
Windows Permission Model #
Important: Windows desktop (Win32) apps do not have a mobile-style permission model. Unlike iOS and Android, there are no per-app permission dialogs shown to the user.
How Permissions Work on Windows #
- Default state: Desktop apps are allowed access to most resources (camera, microphone, location, etc.) by default.
- No runtime popups: The OS does not show permission consent dialogs for Win32 desktop apps. Calling
requestPermission()checks the current status but will not trigger a system popup. - User control: Users manage privacy settings system-wide via Windows Settings > Privacy & Security. Each privacy category (Camera, Microphone, Location, etc.) has a toggle for "Let desktop apps access your [resource]".
Permission Behavior Reference #
| Permission | Behavior on Windows |
|---|---|
| Camera | Checks via WinRT DeviceAccessInformation. Returns actual status based on Windows Privacy settings. |
| Microphone | Checks via WinRT DeviceAccessInformation. Returns actual status based on Windows Privacy settings. |
| Location | Checks via WinRT Geolocator::RequestAccessAsync. Returns actual status based on Windows Privacy settings. |
| Bluetooth | Checks via WinRT DeviceAccessInformation. Returns actual status based on Windows Privacy settings. |
| Notification | Always granted — Win32 apps can send notifications without restriction. |
| Photos / Videos / Audio | Always granted — Win32 apps have full filesystem access. |
| Storage | Always granted — no filesystem sandbox on Windows. |
| Contacts / Calendar / Reminders | Always granted — no system-level permission gate for Win32 apps. |
| Sensors / Speech / MediaLibrary | Always granted — no permission API exists on Windows. |
| Phone / SMS | Always granted — not applicable to desktop platforms. |
| AppTrackingTransparency | Always granted — Apple-only concept. |
Possible Return Values for Gated Permissions #
For Camera, Microphone, Location, and Bluetooth, the following statuses may be returned:
| Status | Meaning |
|---|---|
granted |
Access is allowed in Windows Privacy settings. |
permanentlyDenied |
The user has disabled access in Windows Settings. |
restricted |
Access is denied by system policy (e.g., Group Policy, MDM). |
notDetermined |
The status could not be determined. |
Recommended Usage Pattern #
Since Windows doesn't show permission dialogs, the recommended pattern is to check the status and direct the user to Windows Settings if denied:
import 'package:permission_plus/permission_plus.dart';
final status = await PermissionPlus.checkPermission(PermissionType.camera);
if (status == PermissionStatus.granted) {
// Proceed with camera access
} else {
// Show a message explaining the user needs to enable access
// in Windows Settings, then open the settings page:
await PermissionPlus.openSettings();
}
openSettings() #
Opens Windows Settings > Privacy & Security (ms-settings:privacy) so users can manage privacy toggles directly from your app.
Issues #
Please file any issues or feature requests at the issue tracker.