Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Fix iOS Airplane mode #95 #104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/src/view/impl/mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,25 @@ class _WebViewXState extends State<WebViewX> {
? wf.AutoMediaPlaybackPolicy.always_allow
: wf.AutoMediaPlaybackPolicy.require_user_action_for_all_media_types;

void onWebResourceError(wf_pi.WebResourceError err) =>
void onWebResourceError(wf_pi.WebResourceError err) {
WebResourceErrorType? errorType;
try {
errorType = WebResourceErrorType.values.singleWhere(
(value) => value.toString() == err.errorType.toString(),
);
} catch (error) {
errorType = null;
}
widget.onWebResourceError!(
WebResourceError(
description: err.description,
errorCode: err.errorCode,
domain: err.domain,
errorType: WebResourceErrorType.values.singleWhere(
(value) => value.toString() == err.errorType.toString(),
),
errorType: errorType,
failingUrl: err.failingUrl,
),
);
}

FutureOr<wf.NavigationDecision> navigationDelegate(
wf.NavigationRequest request,
Expand Down