PlatformWebViewPermissionRequest class abstract
Permissions request when web content requests access to protected resources.
A response MUST be provided by calling a provided method.
Platform specific implementations can add additional methods when extending this class.
This example demonstrates how to extend the PlatformWebViewPermissionRequest to provide additional platform-specific features:
class WebKitWebViewPermissionRequest extends PlatformWebViewPermissionRequest {
const WebKitWebViewPermissionRequest._({
required super.types,
required void Function(WKPermissionDecision decision) onDecision,
}) : _onDecision = onDecision;
final void Function(WKPermissionDecision) _onDecision;
@override
Future<void> grant() async {
_onDecision(WKPermissionDecision.grant);
}
@override
Future<void> deny() async {
_onDecision(WKPermissionDecision.deny);
}
Future<void> prompt() async {
_onDecision(WKPermissionDecision.prompt);
}
}
- Annotations
Constructors
-
PlatformWebViewPermissionRequest({required Set<
WebViewPermissionResourceType> types}) -
Creates a PlatformWebViewPermissionRequest.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
types
→ Set<
WebViewPermissionResourceType> -
All resources access has been requested for.
final
Methods
-
deny(
) → Future< void> - Deny permission for the requested resource(s).
-
grant(
) → Future< void> - Grant permission for the requested resource(s).
-
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