PermissionScreen class
A full-screen, platform-adaptive page for explaining a permission request or guiding the user to Settings.
This is entirely additive: PermissionManager and the built-in
dialogs (PermissionInitialDialog, PermissionPermanentDialog,
PermissionDeniedDialog) are unchanged and still the default
behavior for existing callers. Use this screen instead of a dialog
when you want a full page — e.g. pushed as its own route during
onboarding — rather than a popup over existing content.
Usage:
final granted = await Navigator.of(context).push<bool>(
MaterialPageRoute(
builder: (_) => PermissionScreen(
permissions: [PermissionType.camera, PermissionType.microphone],
mode: PermissionScreenMode.explanation,
),
),
);
Returns true via Navigator.pop if the user tapped the primary
action (Allow Access / Open Settings), false if they tapped the
secondary action (Not Now / Cancel) or the platform back action.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PermissionScreen
Constructors
-
PermissionScreen({Key? key, required List<
PermissionType> permissions, required PermissionScreenMode mode, String? title, String? message, String? primaryButtonText, String? secondaryButtonText, Future<bool> onPrimaryAction()?, Stream<bool> ? externalProcessingStream}) -
const
Properties
-
externalProcessingStream
→ Stream<
bool> ? -
Optional externally-driven processing signal. When provided,
this screen's "is an operation in progress" state comes from
here instead of its own local tracking — pass a stream built
from the real Riverpod-backed PermissionUiState (e.g. via
permissionStateProvider, filtered/mapped to a bool for whichever states count as "busy":requesting,openingSettings, etc.) so the same operation-state machine the rest of the package uses is what actually drives this UI, rather than a second, independentStatefulWidget-local flag.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- message → String?
-
final
- mode → PermissionScreenMode
-
final
-
onPrimaryAction
→ Future<
bool> Function()? -
Called when the user taps the primary action. Returns whether
the permission requirement is now satisfied:
final
-
permissions
→ List<
PermissionType> -
final
- primaryButtonText → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondaryButtonText → String?
-
final
- title → String?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PermissionScreen> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited