PermissionStrings class

Every generic string the built-in dialogs show. Override any subset for wording or translation; permission-specific wording lives in PermissionTexts.

Templates may use these placeholders, filled in at display time:

Placeholder Becomes
{app} PermissionConfig.appName, or fallbackAppName
{permission} the permission name(s), joined as "Camera and Microphone"
{service} the service name — "Location services", "Bluetooth"
{settings} openSettingsLabel, so steps can say which button

For a localised app, set PermissionConfig.stringsBuilder to pick a PermissionStrings from the BuildContext's locale.

Constructors

PermissionStrings({String fallbackAppName = 'This app', String rationaleTitle = 'Allow {permission} access', String rationaleMessage = '{app} needs {permission} access for this feature to work.', String rationaleMultipleMessage = '{app} needs a few permissions for this feature:', String deniedTitle = '{permission} access denied', String deniedMessage = '{app} needs {permission} access for this feature. You can allow ' 'it now, or anytime later from Settings.', String permanentlyDeniedTitle = 'Turn on {permission} in Settings', String permanentlyDeniedMessage = '{permission} access is turned off for {app}, and it can only be ' 'turned back on from Settings.', String stepsTitle = 'How to enable it:', String restrictedTitle = '{permission} access is restricted', String restrictedMessage = 'This device doesn\'t allow {permission} access for {app}, usually ' 'because of parental controls or a work profile. Ask the person who ' 'manages this device to allow it.', String serviceDisabledTitle = 'Turn on {service}', String serviceDisabledMessage = '{app} needs {service} turned on for this feature. You can turn it ' 'on in Settings.', String locationServiceName = 'Location services', String bluetoothServiceName = 'Bluetooth', String continueLabel = 'Continue', String notNowLabel = 'Not now', String allowLabel = 'Allow', String openSettingsLabel = 'Open Settings', String okLabel = 'OK', List<String> androidSettingsSteps = const ['Tap "{settings}" below.', 'Go to Permissions.', 'Tap {permission}.', 'Choose Allow.'], List<String> iosSettingsSteps = const ['Tap "{settings}" below.', 'Tap {permission}.', 'Turn it on or choose an allowed option.'], List<String> androidSpecialAccessSteps = const ['Tap "{settings}" below.', 'Turn on {permission} for {app}.', 'Come back to {app}.'], String listSeparator = ', ', String listLastSeparator = ' and ', String permissionGateTitle = '{permission} access needed', String permissionGateMessage = 'Allow {permission} access to use this feature.'})
const

Properties

allowLabel → String
final
androidSettingsSteps → List<String>
Generic steps for the Settings dialog. PermissionTexts can replace them per permission.
final
androidSpecialAccessSteps → List<String>
Steps for Android permissions that live on their own settings screen (AppPermission.opensSystemSettings).
final
bluetoothServiceName → String
final
continueLabel → String
final
deniedMessage → String
final
deniedTitle → String
final
fallbackAppName → String
final
hashCode → int
The hash code for this object.
no setterinherited
iosSettingsSteps → List<String>
final
listLastSeparator → String
final
listSeparator → String
Joins permission names: "Camera, Photos and Microphone".
final
locationServiceName → String
final
notNowLabel → String
final
okLabel → String
final
openSettingsLabel → String
final
permanentlyDeniedMessage → String
final
permanentlyDeniedTitle → String
final
permissionGateMessage → String
final
permissionGateTitle → String
final
rationaleMessage → String
Used only when the permission has no rationale of its own — and every built-in permission has one in defaultPermissionTexts. To translate the rationales, set them per permission through PermissionConfig.texts or textsBuilder, together with the names.
final
rationaleMultipleMessage → String
Heading above the list when several permissions are asked at once.
final
rationaleTitle → String
final
restrictedMessage → String
final
restrictedTitle → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serviceDisabledMessage → String
final
serviceDisabledTitle → String
final
stepsTitle → String
Heading above the numbered steps.
final

Methods

copyWith({String? fallbackAppName, String? rationaleTitle, String? rationaleMessage, String? rationaleMultipleMessage, String? deniedTitle, String? deniedMessage, String? permanentlyDeniedTitle, String? permanentlyDeniedMessage, String? stepsTitle, String? restrictedTitle, String? restrictedMessage, String? serviceDisabledTitle, String? serviceDisabledMessage, String? locationServiceName, String? bluetoothServiceName, String? continueLabel, String? notNowLabel, String? allowLabel, String? openSettingsLabel, String? okLabel, List<String>? androidSettingsSteps, List<String>? iosSettingsSteps, List<String>? androidSpecialAccessSteps, String? listSeparator, String? listLastSeparator, String? permissionGateTitle, String? permissionGateMessage}) → PermissionStrings
joinNames(List<String> names) → String
"A", "A and B", "A, B and C".
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited