A permission granted yesterday may be unavailable when the user returns from system settings. Treat native permission as current capability to verify at the relevant operation, not a permanent flag stored during onboarding.
The interface should preserve useful work while explaining what changed. A revoked camera or file permission should not silently discard the form that needed it.
Model capability more precisely than allowed or denied
Depending on the platform and API, meaningful states can include not requested, granted, denied, limited, unavailable, or requiring a settings change. Review the actual native documentation and plugin contract for the supported versions.
Flutter's lifecycle listener reference helps identify application transitions, while permission checks still need the correct native implementation. A resume callback is an opportunity to refresh state, not proof that permission changed.
Test a fictional inspection camera flow
Suppose an inspector opens a report, attaches a photo, then goes to system settings and revokes access. On return, the app refreshes capability and prevents unsupported capture while retaining the report and existing valid attachments under policy.
Test first request, denial, grant, revocation while a feature is open, limited access where applicable, and a permission change during an in-flight operation. Verify both Dart state and native outcome.
If the platform requires another route to restore access, explain that route without repeatedly triggering a prompt that cannot succeed. Do not equate every SDK failure with denied permission; missing hardware and invalid files can need different actions.
Keep requests timely and context-specific
Ask for permission when the user reaches the task that needs it, with an explanation tied to that task. Avoid demanding unrelated capabilities merely to enter the app unless the actual product requires them.
Review cleanup after revocation. Active listeners, capture sessions, temporary files, or subscriptions may need release according to the native API. A stale allowed badge should not leave resources running outside the intended feature lifecycle.
The tradeoff is convenience versus accurate state and user control. Caching can simplify presentation, but the operation must handle the real current outcome. Frequent unnecessary prompts or checks can also frustrate users, so refresh at meaningful boundaries.
The Social App case study documents Flutter and native work. This inspection permission flow is fictional and makes no claim about its implementation or platform-specific access policy.
Questions about changing permissions
Can onboarding permission state be trusted forever?
No. Users and the operating system can change capability. Handle the actual current result when the feature runs.
Should revocation erase the user's form?
Not automatically. Preserve unrelated work under the data policy and explain which capability is unavailable.
What should be tested first?
Revoke permission in settings while a populated feature is open, then resume and act. Bring stale state or lost work to a native-permission review.