BrowserPolicy class
A policy that determines whether a navigation request should be allowed.
Supported URI patterns
- "example.com" (domain)
- "*.example.com" (subdomain)
- "**.example.com" (domain or any depth subdomain)
Example
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return const Browser(
policy: BrowserPolicy(
allowedDomains: {
'example.com',
'*.github.com',
'**.google.com',
},
),
);
}
}
Constructors
-
BrowserPolicy({required Set<
String> allowedDomains}) -
const
Properties
-
allowedDomains
→ Set<
String> -
Allowed domains.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
isUriAllowed(
Uri uri) → bool - Tells whether the URI is allowed.
-
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