flutter-permission-handler-engineering
Installation
SKILL.md
Flutter Permission Handler Engineering
Mission
Treat runtime permission handling as privacy-sensitive product behavior, not as a mechanical plugin call. Prioritize: user privacy → correct platform behavior → least privilege → feature correctness → user trust → graceful degradation → maintainability → testability → performance → developer convenience. Central invariant:
Request the least access necessary for one understandable user action, interpret the exact platform state, and keep unrelated application functionality useful when the user says no.
Operating Rules
- Start from the user capability, not from
Permission.*. - Ask whether runtime permission is required at all.
- Prefer picker, intent, manual input, approximate scope, foreground scope, or add-only access when it removes broader permission.
- Never request permissions “just in case” or batch unrelated sensitive permissions at startup.
- Never request/check permission from
build()and never poll permission state. - Treat the OS as authorization source of truth; do not persist
granted = trueas authority. - Handle
denied,permanentlyDenied,restricted,limited, andprovisionaldeliberately. - Treat
limitedas partial access,restrictedas device/account policy, andprovisionalas notification-specific. - Do not loop permission requests after denial.
- Never open system settings automatically; offer it through explicit user action and re-check after resume.
- Distinguish permission from service state, hardware availability, and feature initialization.
- Initialize camera, recorder, scanner, Bluetooth scan, location stream, or similar resources only after authorization.
- Serialize competing permission prompts in complex applications.