Intention class
A high-level grouping of Permissions that together enable a user-facing feature.
Instead of managing individual permissions, express what the app intends to do and let the plugin resolve the correct permission set:
// Request everything needed for SMS messaging
final result = await SimplePermissionsNative.instance.requestIntention(
Intention.texting,
);
Built-in intentions
- Intention.texting — SMS/MMS runtime permissions
- Intention.calling — Phone/dialer runtime permissions
- Intention.contacts — Read/write contacts
- Intention.device — Phone state and device info
- Intention.mediaImages — Photo/image access (version-aware)
- Intention.mediaVideo — Video access (version-aware)
- Intention.mediaAudio — Audio file access (version-aware)
- Intention.notifications — Post notifications
- Intention.location — Fine + coarse location
- Intention.camera — Camera access
- Intention.microphone — Audio recording
- Intention.defaultSmsRole — Request default SMS app role explicitly
- Intention.defaultDialerRole — Request default dialer role explicitly
Custom intentions
Consuming apps can compose custom intentions:
const myFeature = Intention('video_call', [
CameraAccess(),
RecordAudio(),
FineLocation(),
]);
Constructors
-
Intention(String name, List<
Permission> permissions) -
const
-
Intention.combine(String name, List<
Intention> intentions) -
Combine multiple intentions into one.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Human-readable name for this intention (used in logging/debugging).
final
-
permissions
→ List<
Permission> -
The permissions required to fulfill this intention.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- calling → const Intention
- Phone/dialer runtime permissions.
- callingWithDefaultDialerRole → const Intention
- Calling runtime permissions plus the default dialer role.
- camera → const Intention
- Camera access.
- contacts → const Intention
- Contact access — read and write the device contact book.
- defaultDialerRole → const Intention
- Request the default dialer role explicitly.
- defaultSmsRole → const Intention
- Request the default SMS app role explicitly.
- device → const Intention
- Device info — phone state, phone numbers.
- location → const Intention
- Location — foreground-only (fine + coarse) location.
- mediaAudio → const Intention
- Audio file access — version-aware (API 33 split handled automatically).
- mediaImages → const Intention
- Image/photo access — version-aware (API 33 split handled automatically).
- mediaVideo → const Intention
- Video access — version-aware (API 33 split handled automatically).
- mediaVisual → const Intention
- All visual media (images + video) — version-aware.
- microphone → const Intention
- Microphone / audio recording.
- notifications → const Intention
- Notifications — post notifications to the user.
- texting → const Intention
- SMS/MMS runtime permissions.
- textingWithDefaultSmsRole → const Intention
- SMS/MMS runtime permissions plus the default SMS app role.